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
Original bug ID: 1380 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
I have a parser, which is very originally defined in
parser.mly file. Here's what happens when I try to compile it:
[alex@athlon text_to_xml]$ ocamlyacc parser.mly
[alex@athlon text_to_xml]$ ocamlfind ocamlc -package report
-c parser.ml
File "parser.mly", line 83, characters 30-42:
This expression is not a function, it cannot be applied
[alex@athlon text_to_xml]$ wc parser.mly
69 243 1721 parser.mly
There error message is entirely nonsensical, for parser.mly
only has 69 lines. So where in my code is the error precisely?
Alex
The text was updated successfully, but these errors were encountered:
I have a parser, which is very originally defined in
parser.mly file. Here's what happens when I try to compile it:
[alex@athlon text_to_xml]$ ocamlyacc parser.mly
[alex@athlon text_to_xml]$ ocamlfind ocamlc -package report
-c parser.ml
File "parser.mly", line 83, characters 30-42:
This expression is not a function, it cannot be applied
[alex@athlon text_to_xml]$ wc parser.mly
69 243 1721 parser.mly
There error message is entirely nonsensical, for parser.mly
only has 69 lines. So where in my code is the error precisely?
The reason for the funky line number is the following. ocamlyacc
generates the parser.ml file with the following format:
"parser.mly" lineno1
# "parser.mly" lineno2
...
Hence an error in the postlude will be reported as coming from parser.mly
(because the last # "parser.mly" lineno directive is still active),
but with a wrong line number.
Normally, type errors in the actions should not cause errors in the
postlude, but apparently you've found a case where it does. If you'd
like to track it down, you can edit the generated parser.ml, delete
all # "parser.mly" lines, and ocamlc parser.ml again.
Original bug ID: 1380
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
I have a parser, which is very originally defined in
parser.mly file. Here's what happens when I try to compile it:
[alex@athlon text_to_xml]$ ocamlyacc parser.mly
[alex@athlon text_to_xml]$ ocamlfind ocamlc -package report
-c parser.ml
File "parser.mly", line 83, characters 30-42:
This expression is not a function, it cannot be applied
[alex@athlon text_to_xml]$ wc parser.mly
69 243 1721 parser.mly
There error message is entirely nonsensical, for parser.mly
only has 69 lines. So where in my code is the error precisely?
Alex
The text was updated successfully, but these errors were encountered: