smelly code in input.c
Anthony Clayden
anthony.d.clayden at gmail.com
Mon Jun 14 10:47:39 UTC 2021
(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 ...)
In /src/input.c line 1714
https://github.com/FranklinChen/hugs98-plus-Sep2006/blob/master/src/input.c#L1714
,
> if (c0=='.' && isIn(c0,(SMALL|LARGE|SYMBOL))) {
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.
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.
Can anyone confirm my suspicion and/or suggest a definitive test?
(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.)
AntC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/hugs-bugs/attachments/20210614/1e3de2ef/attachment.html>
More information about the Hugs-Bugs
mailing list