You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Misspelled nonterminals are not caught by CAMLYACC nor by subsequent
compilation.
It appears that the new YACC converts non-terminal names into "modern"-style
backquoted polymorphic variant labels. A misspelled label makes its way through
all stages of compilation without complaint, but of course, the end result does
not work as expected. This can be a very difficult bug to track down!
The second clause has a hard to notice misspelling: the correct nonterminal name
is
"option_pattern_list", but the misspelling is "option_patternM_list"
(misspelling
capitalized so you can see it more easily). When compiled the parser fails with
syntax errors galore where it was intended to handle the clause without
complaint.
I beleive this behavior is new to version 2.99, but I have not tried
misspellings on
any of the older versions recently...
The text was updated successfully, but these errors were encountered:
Misspelled nonterminals are not caught by CAMLYACC nor by subsequent
compilation.
ocamlyacc produces warning messages in this situation:
boot/ocamlyacc: w - the symbol XXXX is undefined
For reasons that escape me, this is a warning, not an error. This
behavior was inherited from the original Berkeley yacc on which
ocamlyacc is based; maybe we should emit an error instead of a warning.
It appears that the new YACC converts non-terminal names into
"modern"-style backquoted polymorphic variant labels.
No, no, we haven't changed ocamlyacc to use polymorphic variants.
The quote-like characters you see in the generated .ml file are single
quotes ' denoting type variables, not backquotes ` denoting variant
constructors.
I beleive this behavior is new to version 2.99, but I have not tried
misspellings on any of the older versions recently...
I think this behavior has been there for a long time, probably since
Caml Light.
Original bug ID: 63
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: David McClain
Version: 2.99
OS: Win/NT 4.0 (pl 3)
Submission from: dialup001ip074.tus.azstarnet.com (169.197.12.74)
Misspelled nonterminals are not caught by CAMLYACC nor by subsequent
compilation.
It appears that the new YACC converts non-terminal names into "modern"-style
backquoted polymorphic variant labels. A misspelled label makes its way through
all stages of compilation without complaint, but of course, the end result does
not work as expected. This can be a very difficult bug to track down!
E.g.,
param_tail:
AMPEROPT option_pattern_list
{ $2 }
| AMPEROPT option_patternm_list COMMA AMPERKEY key_pattern
{ $5 @ $2 }
| AMPERKEY key_pattern
{ $2 }
;
The second clause has a hard to notice misspelling: the correct nonterminal name
is
"option_pattern_list", but the misspelling is "option_patternM_list"
(misspelling
capitalized so you can see it more easily). When compiled the parser fails with
syntax errors galore where it was intended to handle the clause without
complaint.
I beleive this behavior is new to version 2.99, but I have not tried
misspellings on
any of the older versions recently...
The text was updated successfully, but these errors were encountered: