DulLabs / bhai-lang

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

Adding class features #257

Open thecodacus opened 2 years ago

thecodacus commented 2 years ago

What does this PR do?

It adds the functionality of classes to the language

hi bhai
  samajh le bhai kutta{
    bhai ye hai nam;
    apna funda janam(nam){
      iska.nam = nam;
      bol bhai iska.nam,":kau kau";
    }
    apna funda bhouk(){
      bol bhai iska.nam+":bhou bhou";
    }
  }
  bhai ye hai jimmi = kutta("jimmi");
  jimmi.bhouk();
  bol bhai "iska name hai",jimmi.nam;

bye bhai

Outputs:

jimmi :kau kau
jimmi:bhou bhou
iska name hai jimmi

What packages have been affected by this PR?

The PR will Change the Data storage structure in the interpreter

Types of changes

What types of changes does your code introduce to this project?

Put an x in the boxes that apply

Package version increase in cli package?

No

Checklist before merging

Put an x in the boxes that apply

netlify[bot] commented 2 years ago

Deploy Preview for bhailang-preview ready!

Name Link
Latest commit 8f55ab735e0bb6f477933c2fae08a0bc6cacf72f
Latest deploy log https://app.netlify.com/sites/bhailang-preview/deploys/638493c20592f400096d89a3
Deploy Preview https://deploy-preview-257--bhailang-preview.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

lgtm-com[bot] commented 2 years ago

This pull request introduces 2 alerts when merging 1b22846c72ed0463dc217e5ee97e21c4a715a799 into dd076b3ec71113c29fe63c58128a7ffc7dd7d7c9 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 1 year ago

This pull request introduces 2 alerts when merging e02f30bb1a6e830d9cc9581e97fc886542822f75 into de68714357e159719b85fae34c0df58d4ba5ce81 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 1 year ago

This pull request introduces 2 alerts when merging 900f5b7615c4dd143ff3bdc38bacc6b1054f02a1 into de68714357e159719b85fae34c0df58d4ba5ce81 - view on LGTM.com

new alerts:

Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine :gear: that powers LGTM.com. For more information, please check out our post on the GitHub blog.

lgtm-com[bot] commented 1 year ago

This pull request introduces 2 alerts when merging 8f55ab735e0bb6f477933c2fae08a0bc6cacf72f into de68714357e159719b85fae34c0df58d4ba5ce81 - view on LGTM.com

new alerts:

Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine :gear: that powers LGTM.com. For more information, please check out our post on the GitHub blog.