[Cuis-dev] Parser gets confused when using $| in binary selectors

Luciano Notarfrancesco luchiano at gmail.com
Mon May 9 11:21:25 PDT 2022


Martin,
Thanks for the very detailed explanation! I went ahead and replaced '@-'
with '@ -' in the image and the tests. There are still 10 tests producing
errors because the decompiler decompiles it without the space, tho.


On Mon, May 9, 2022 at 5:04 PM Martin McClure <martin at hand2mouse.com> wrote:

> The ANSI Smalltalk grammar says that "@-" should be a valid binary
> selector, and would require whitespace in "1@ -1" to interpret the
> argument as a literal negative one.
>
> The Blue Book grammar, though, does not allow "@-" as a binary selector.
> The Blue Book grammar, as printed, also does not allow "," as a binary
> selector, even though that was clearly used as a binary selector in
> Smalltalk-80. The Blue Book grammar also does not talk about whitespace at
> all, even though that is clearly required in some places, so the Blue Book
> is a bit fuzzier than one would want as a grammar reference.
>
> Going with ANSI-like grammar and putting a space in expressions like "1 @-
> 1" makes more sense to me. Allows more valid selectors, and the code is
> more readable with the whitespace.
>
> Regards,
> -Martin
>
> On 5/9/22 03:48, Luciano Notarfrancesco via Cuis-dev wrote:
>
> After this change '1 at -1' is parsed as a binary message #@-, and this
> causes some base image tests to fail. Should we add a space between @ and
> -1 or should we fix the parser?
>
> On Fri, May 6, 2022 at 1:56 PM Luciano Notarfrancesco <luchiano at gmail.com>
> wrote:
>
>> That was quick. Thanks a lot!
>>
>> On Fri, 6 May 2022 at 8:55 PM Juan Vuletich <JuanVuletich at zoho.com>
>> wrote:
>>
>>> On 5/6/2022 10:48 AM, Luciano Notarfrancesco via Cuis-dev wrote:
>>>
>>> I’m not sure I was clear, I meant a method implementing those messages,
>>> not sending those messages.
>>>
>>> On Fri, 6 May 2022 at 1:22 PM Luciano Notarfrancesco <luchiano at gmail.com>
>>> wrote:
>>>
>>> I’m getting “Argument name expected” when trying to compile a method
>>> with selector <|. On the other hand, |>, | and || all compile fine as
>>> binary selectors, but || breaks syntax highlighting.
>>>
>>>
>>> Sure. Fixes at GitHub now.
>>>
>>> A small detail: Now an empty temporal declaration `||` is parsed as a
>>> binary selector, and therefore marked as invalid. Not a big deal. We'd just
>>> remove any such.
>>>
>>> Cheers,
>>>
>>> --
>>> Juan Vuletichwww.cuis-smalltalk.orghttps://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Devhttps://github.com/jvuletichhttps://www.linkedin.com/in/juan-vuletich-75611b3https://independent.academia.edu/JuanVuletichhttps://www.researchgate.net/profile/Juan-Vuletichhttps://patents.justia.com/inventor/juan-manuel-vuletichhttps://twitter.com/JuanVuletich
>>>
>>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220509/a56a5c22/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 5142-AtMinusFixes-LucianoEstebanNotarfrancesco-2022May09-17h58m-len.001.cs.st
Type: application/octet-stream
Size: 12581 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220509/a56a5c22/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UnsavedChangesTo-BaseImageTests-len.001.cs.st
Type: application/octet-stream
Size: 5696 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20220509/a56a5c22/attachment-0003.obj>


More information about the Cuis-dev mailing list