Open dram opened 2 years ago
Is Scanner allowUnderscoreAsAssignment
enabled?
It is tested in vanilla Squeak 6.0 alpha image (21736-64bit) with no preferences changed, Scanner allowUnderscoreAsAssignment
is enabled.
This bug will only be triggered when sample code is defined as method in browser, run it in workspace will not work.
This bug is revealed by preference SHTextStylerST80 syntaxHighlightingAsYouTypeAnsiAssignment
, which is not enabled in Squeak 5.3.
BTW, it seems strange that, in Squeak 6.0 alpha, both SHTextStylerST80 syntaxHighlightingAsYouTypeAnsiAssignment
and SHTextStylerST80 syntaxHighlightingAsYouTypeLeftArrowAssignment
are enabled.
Preferences fixed via ShoutCore-mt.93. If only one or the other preference is enabled, this bug does not occur.
It can still be reproduced in Squeak6.0beta-21883, following are detailed steps:
Foo
in System Browserfoo
with following code:
foo
| a |
self halt.
a _ 1.
Foo foo
in WorkspaceFoo class>>foo
...having the following preferences set:
[ ] syntaxHighlightingAsYouTypeAnsiAssignment
[x] syntaxHighlightingAsYouTypeLeftArrowAssignment
Hmm... if you have both disabled, it works. Seems to be that if the actual sources contain a :=
and Shout tries to map that to _
(i.e. "the left arrow" depending on your code font), which breaks the debugger method map. Probably beause of 1-vs-2 characters...
While debugging Swiki code, I encountered a MNU when code contains
_
as assignment operator, e.g.:Squeak version: Squeak6.0alpha-21736-64bit-202204190959-Windows-x64