Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find outermost paren doesn't ignore comments #65

Open
x37v opened this issue Mar 22, 2020 · 1 comment
Open

find outermost paren doesn't ignore comments #65

x37v opened this issue Mar 22, 2020 · 1 comment

Comments

@x37v
Copy link
Contributor

x37v commented Mar 22, 2020

open

(
  //(
  "got it".postln;
)

:call SClang_block() anywhere inside gives an error about unmatched paren

closed

(
  //)
  "got it".postln;
)

:call SCLang_block() on the "got it" line gives an error about unmatched paren as well, if you eval on the //) line, the block block is sent to sclang and you get this error:

ERROR: Command line parse failed
-> nil
ERROR: syntax error, unexpected $end, expecting ')'
  in interpreted text
  line 3 char 1:

Because, I assume, the block that is sent is:

(
  //)
@kneitinger
Copy link

kneitinger commented Aug 12, 2020

Weirdly enough, I consider this to be a helpful feature...

It's totally possible that I'm missing something about calling sclang from the command-line, but in all of my scd files, I've commented out the parens due to syntax errors when executing sclang my_super_cool_synth.scd with block parens.

With the parens commented in the behavior you described, I can have the best of both worlds: blocks in scvim and easy command-line running of files.

I wonder if there is a compromise here that can result in a more expected and predictable behavior for both of our use cases.

What if the situation you described was fixed, and blocks like

(
  //)
  "got it".postln;
)

work perfectly and the commented paren is ignored, but at the same time, using a documented token like ///( or //-( , code block delimiting parens could live in a comment. For example

$ cat gottem.scd
//-(
  //)
  "got it".postln;
//-)

would print "got it" in scvim when F5-ed and also print it when ran via sclang gottem.scd.

Curious about other people's thoughts. Is this a reasonable solution? Am I doing something wrong with my invocation of sclang? Does anybody else rely on commented parens being recognized (ideally only block-level ones)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants