zom-lang / zom

Zom is a Ahead Of Time compiled system programming language.
Other
4 stars 2 forks source link

Improve REPL #11

Closed Larsouille25 closed 1 year ago

Larsouille25 commented 1 year ago

Is your feature request related to a problem? Please describe. No, actually not but it's cool.

Describe the solution you'd like when you're in the REPL, you can have mutli line, by pressing enter and when you finished you press ctrl + d or a thing like that.

Additional context Like that ->

Mona v0.1.0-alpha, to exit enter `.quit`
~> func foo(bar) {
 .     var a = bar
 .     a = bar + 2
 .     // etc ..
 . }
${ctrl + d here}
~> 

where ${ctrl + d here} isn't show up but it's when the user press ctrl + d

Larsouille25 commented 1 year ago

Instead of point I will use >. Like that ->

Mona v0.1.0-alpha, to exit enter `.quit`
~> func foo(bar) {
 >     var a = bar
 >     a = bar + 2
 >     // etc ..
 > }
${ctrl + n here}
~> 

and the shortcut to finish a line will be ctrl + n

Larsouille25 commented 1 year ago

In the final version of the multiline REPL this like that ->

$ mona
Mona v0.1.0-alpha, to exit enter `.quit`
~> func foo(bar) {
 >     var a = bar
 >     a = bar + 2
 >     // etc ..
 > }
 > .eof
~>

Instead of pressing ctrl + d or ctrl + n, you just need to enter .eof to tell the multiline REPL that this is the end.