JoeStrout / miniscript

source code of both C# and C++ implementations of the MiniScript scripting language
MIT License
280 stars 64 forks source link

[C++] Line continuation via keyword (e.g. and, or, not) fails #95

Closed JoeStrout closed 8 months ago

JoeStrout commented 1 year ago

In command-line (C++) MiniScript, if line continuation is done via a keyword like and, not, or or, it gets concatenated directly with the start of the next line. There should instead be an implicit whitespace.

Example:

> print not
>>> true
Runtime Error: Undefined Identifier: 'nottrue' is unknown in this context [line 1]

Example 2:

> print 4 and
>>> 2
Compiler Error: got Identifier(and2) where Comma or EOL is required [line 1]
Withered-Flower-0422 commented 1 year ago

Note that new also share the same problem.


> a = {}
> b = new
>>> a
Runtime Error: Undefined Identifier: 'newa' is unknown in this context [line 1]