squeak-smalltalk / squeak-object-memory

Issues and assets related to the Squeak object memory.
https://bugs.squeak.org
MIT License
12 stars 1 forks source link

MNU when debugging code contains `_` as assignment operator in Squeak 6.0 alpha #19

Open dram opened 2 years ago

dram commented 2 years ago

While debugging Swiki code, I encountered a MNU when code contains _ as assignment operator, e.g.:

foo: anInteger
    self halt.
    foo _ anInteger

image

Squeak version: Squeak6.0alpha-21736-64bit-202204190959-Windows-x64

marceltaeumel commented 2 years ago

Is Scanner allowUnderscoreAsAssignment enabled?

dram commented 2 years ago

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.

dram commented 2 years ago

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.

marceltaeumel commented 2 years ago

Preferences fixed via ShoutCore-mt.93. If only one or the other preference is enabled, this bug does not occur.

dram commented 2 years ago

It can still be reproduced in Squeak6.0beta-21883, following are detailed steps:

  1. Create a class Foo in System Browser
  2. Create a class method foo with following code:
    foo
       | a |
       self halt.
       a _ 1.
  3. Do Foo foo in Workspace
  4. Select stack frame Foo class>>foo
marceltaeumel commented 2 years ago

...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...