<div dir="ltr">Hi,<div><br></div><div>I don't not know that code either, but looking at the comments and the surrounding code, my guess is that the 2nd `c0` should be `c1`,</div><div>and it is checking for something like `.` followed by either a lower case or upper case or symbol operator.<br></div><div><br></div><div>-Iavor</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jun 14, 2021 at 3:48 AM Anthony Clayden <<a href="mailto:anthony.d.clayden@gmail.com">anthony.d.clayden@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">(I can't say for sure I have a bug, because I don't grok the code well enough to figure out how to make something go wrong, but ...)<div><br></div><div>In /src/input.c line 1714 <a href="https://github.com/FranklinChen/hugs98-plus-Sep2006/blob/master/src/input.c#L1714" target="_blank">https://github.com/FranklinChen/hugs98-plus-Sep2006/blob/master/src/input.c#L1714</a>,</div><div><br></div><div>> <span style="color:rgb(36,41,46);font-family:ui-monospace,SFMono-Regular,"SF Mono",Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(255,251,221)"> </span><span style="box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,"SF Mono",Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre-wrap">if</span><span style="color:rgb(36,41,46);font-family:ui-monospace,SFMono-Regular,"SF Mono",Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(255,251,221)"> (c0==</span><span style="box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,"SF Mono",Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre-wrap"><span style="box-sizing:border-box">'</span>.<span style="box-sizing:border-box">'</span></span><span style="color:rgb(36,41,46);font-family:ui-monospace,SFMono-Regular,"SF Mono",Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(255,251,221)"> && </span><span style="box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,"SF Mono",Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre-wrap">isIn</span><span style="color:rgb(36,41,46);font-family:ui-monospace,SFMono-Regular,"SF Mono",Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(255,251,221)">(c0,(SMALL|LARGE|SYMBOL))) {</span></div><div><span style="color:rgb(36,41,46);font-family:ui-monospace,SFMono-Regular,"SF Mono",Consolas,"Liberation Mono",Menlo,monospace;font-size:12px;white-space:pre-wrap;background-color:rgb(255,251,221)"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif">It looks wrong to be testing `c0` twice, that test will always come out False. (Or if '.' counts as a SYMBOL, then always True.) I guess the second test should be lookahead `isIn(c1, ...)`. That follows the code pattern nearby above line 1688, and especially 1698.</span></div><div><span style="font-family:Arial,Helvetica,sans-serif"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif">I think it'll mean the compiler won't handle multi-qualified names like `Mod1.Sub2.Subsub3.Foo`. Whereas `Prelude.True` (just a single qualifier) is ok.</span></div><div><span style="font-family:Arial,Helvetica,sans-serif"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif">Can anyone confirm my suspicion and/or suggest a definitive test?</span></div><div><span style="font-family:Arial,Helvetica,sans-serif"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif">(Reason for asking: I'm trying to persuade Hugs to differentiate tight-binding dot as an operator vs space-surrounded dot as function composition. In particular so I can write `record.label` as field access. I'd also like to write `record.#label` as a TRex field access.)</span></div><div><span style="font-family:Arial,Helvetica,sans-serif"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif">AntC</span></div><div><span style="font-family:Arial,Helvetica,sans-serif"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif"><br></span></div><div><br></div></div>
</div></div>
_______________________________________________<br>
Hugs-Bugs mailing list<br>
<a href="mailto:Hugs-Bugs@haskell.org" target="_blank">Hugs-Bugs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/hugs-bugs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/hugs-bugs</a></blockquote></div>