musikinformatik / Steno

Concatenative little metalanguage for live coding
GNU General Public License v2.0
65 stars 7 forks source link

parenthesis removal breaks standard sc behaviour #4

Closed LFSaw closed 7 years ago

LFSaw commented 7 years ago

the preprocessor directive

Steno:push {|pushSyntax = true|
[...]
    if(string.beginsWith("(") and: string.endsWith(")")) { string = string.drop(1).drop(-1) };
[...]
}

breaks standard SC behaviour for

(1 + 3) * (4 * 3)

(note there's no trailing space at the end of the line) with

ERROR: Parse error
  in file 'selected text'
  line 1 char 6:

  1 + 3) * (4 * 3 
       ^
-----------------------------------
unmatched ')'
  in file 'selected text' line 1 char 6
ERROR: syntax error, unexpected BADTOKEN, expecting $end
  in file 'selected text'
  line 1 char 6:

  1 + 3) * (4 * 3 
       ^
-----------------------------------
ERROR: Command line parse failed
-> nil