Closed jamshark70 closed 4 years ago
Oh, it's worse: it also dies on valid standard SC expressions like TempoClock.tempo = 128/60
.
That special slash handling needs to go away.
Worked around by making SuperColliderInterpreter find_comment()
always return empty:
def find_comment(cls, string):
""" instring, instring_char = False, ""
for i, char in enumerate(string):
if char in ('"', "'"):
if instring:
if char == instring_char:
instring = False
instring_char = ""
else:
instring = True
instring_char = char
elif char == "/":
if not instring and i < len(string) and string[i + 1] == "/":
return [(i, len(string))]
"""
return []
But there's probably a better fix.
Good catch, turns out it's a really simple fix, just changing
if not instring and i < len(string) and string[i + 1] == "/":
to
if not instring and (i + 1) < len(string) and string[i + 1] == "/":
It was just not checking if the current character was at the end of the line correctly, which it now is. Should work ok for you now.
Confirmed, yes, that fixes it. Thanks!
In one terminal window, run the server.
In another terminal window, run the client.
The Troop window appears, no problem.
In sclang,
Troop.start
.Load my live coding environment "cll":
\loadAllCl.eval; s.boot;
alt-return (which won't work for you unless you install it... but you might not have to, read on first).Cll commands start with a slash, so, on a new line, start typing:
The first slash ends up displaying two slashes. As you continue to type, characters are entered into the code window in reverse order:
)rnsthgit\(.murd/
Deleting the faulty text causes the client backend to crash ("Connection lost").
To reproduce the issue, you don't need to install my libraries. Just type
/abc
into the client window.The client terminal window has a lot of errors:
So it seems that the Troop editor is trying to do something fancy based on assumptions about SC syntax that don't necessarily hold true about live-coding dialects. (As a workaround I'll enable
#
as a command delimiter in my system -- some muscle memory to overcome, then.)If there is a way to disable the editor's syntax handling, and just use it as a simple text editor, that would be nice.