Actually, although you would have to rework the code that rearranges
expressions according to fixity, the real problem is that changing
the syntax rules as you'd like will cause many conflicts that will
break the parsing of expressions in more fundamental ways. The only
trick that I'm certain would fix this is to expand out the grammar in
the Haskell report (in which certain nonterminals/productions are
indexed by associativities and precedence). The resulting monster
grammar would then parse Haskell expressions correctly, but it would
also completely overshadow the rest of the parser.
I would therefore encourage prudent use of parentheses in sections!
All the best,
Mark
| Sigbjorn Finne <[EMAIL PROTECTED]> reports:
| > Jan 98 release of Hugs - precedence doesn't seem to be taken into
| > account when parsing sections:
| >
| > Prelude> (+2*3)
| > ERROR: Syntax error in expression (unexpected symbol "*")
| > Prelude>
|
| You're right - precedence is completely ignored. The relevant syntax rules
| are:
|
| | '(' pfxExp qop ')'
| | '(' qop atomic ')'
|
| These ought to be:
|
| | '(' exp qop ')'
| | '(' qop exp ')'
|
| but I suspect this would trip up the code that rearranges expressions
| according to fixity declarations.