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 escape sequence in string literals #161

Open pPanda-beta opened 2 years ago

pPanda-beta commented 2 years ago

Description

Add support for escape sequence

hi bhai
  bol bhai "mujhe chor do \"mere\" quotes pe";
bye bhai

and unicode character support

hi bhai
  bol bhai "Made with \u{1F48C} by bhailang community";
bye bhai

Domain

Bhai Lang

Type of Contribution

Enhancement

Code of Conduct

nikhiljainlive commented 2 years ago

The output for the first code can be achieved by the following:

hi bhai 
  bol bhai 'mujhe chor do "mere" quotes pe'; 
bye bhai