DulLabs / bhai-lang

A toy programming language written in Typescript
https://bhailang.js.org/
MIT License
3.97k stars 499 forks source link

feat: Add support for if-else-if ladders in bhailang - #214 #226

Closed vipul0092 closed 2 years ago

vipul0092 commented 2 years ago

This PR closes issue #214 by adding support for if-else-if ladders

Example: hi bhai bhai ye hai x = 10; agar bhai (x < 5) { bol bhai "x < 5"; } nahi to bhai (x < 8) { bol bhai "x < 8"; } nahi to bhai (x < 12) { bol bhai "x < 12"; } nahi to bhai (x < 15) { bol bhai "x < 15"; } bye bhai;

Output: x < 12

netlify[bot] commented 2 years ago

✅ Deploy Preview for bhailang-preview ready!

🔨 Explore the source changes: b335b319d6a8d02d81722d4ca105fe0eee5eb6db

🔍 Inspect the deploy log: https://app.netlify.com/sites/bhailang-preview/deploys/6237f8dd12588d000855d483

😎 Browse the preview: https://deploy-preview-226--bhailang-preview.netlify.app

tbhaxor commented 2 years ago

@vipul0092 Shandar bhai 🎉. Iska syntax highlight bhi kar hi do fir

Screenshot 2022-03-19 at 4 25 29 PM

vipul0092 commented 2 years ago

Requesting review for this change guys @aniketsingh0104 @ankitchouhan1020 @ristri

vipul0092 commented 2 years ago

@aniketsingh0104 Handled the review comments, please take a look once again

vipul0092 commented 2 years ago

@aniketsingh0104 Removed the unnecessary whitespace change in scope.ts, should be good to go now