RioChndr / jaksel-language

Jaksel Script, Programming language very modern and Indonesian style
MIT License
927 stars 91 forks source link

fix/better call argument with string literal #42

Closed RayhanHamada closed 2 years ago

RayhanHamada commented 2 years ago

This PR should fix #41

This allows passing string into multi-parameter function

Suppose we have function that takes 3 parameters

so about fungsiMultiParam a b c
    spill "argumen pertama: " + a
    spill "argumen kedua: " + b
    spill "argumen ketiga: " + c
thats it sih

when we call

literally nama2 itu "budi"

call fungsiMultiParam 2 nama2 "hello world"

it should outputs

argumen pertama: 2
argumen kedua: budi
argumen ketiga: hello world

it also support escaping quotes inside string literal

literally nama2 itu "budi"

call fungsiMultiParam 3 nama2 "and then Romeo says \"I love you\" to Juliet"

it should outputs

argumen pertama: 2
argumen kedua: budi
argumen ketiga: and then Romeo says "I love you" to Juliet
RioChndr commented 2 years ago

Great. Thank you for this patch.