DulLabs / bhai-lang

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

Add support for the functions #154

Open tbhaxor opened 2 years ago

tbhaxor commented 2 years ago

Description

Support bhai bula {name} aur bhej {list of params} the return statement can bhai wapis kar {return}

What it would look like

hi bhai
    bhai bula greet aur bhej name, age {
        bhai wapis kar name + age;
    }
bye bhai

Motivation: https://github.com/DulLabs/bhai-lang/issues/94#issuecomment-1066802303

Domain

Bhai Lang

Type of Contribution

Addition, Enhancement

Code of Conduct

tbhaxor commented 2 years ago

I always wanted to learn how languages work and this seems like a good start. Can I work on this?. It will take some time to understand and then implement.

bhushanvaidya commented 2 years ago

the return statment should be "ye le bhai"

thecodacus commented 2 years ago

added a PR for this, you guys can check it in preview build https://6234ac37ec8e100008f579b5--bhailang-preview.netlify.app/#playground