Skip to content

wrong parse-error line/column numbers at ocaml-menhir backend #380

@JoAllg

Description

@JoAllg

the Test*.ml created by the ocaml-menhir backend does not report parse errors with correct line/column numbers. The error is always
Parse error at 0.-1-0.-1

This can for example be checked with this erroneus grammar test.cf :

`token Nat digit+ ;
token Int '-'? digit+ ;

entrypoints Prog ;
Code. Prog ::= Instr ";" [Instr] ;

separator Instr ";" ;
_.      Instr ::= Instr ";" ;
IPUSH.  Instr  ::= "PUSH" CType Data ;
IADD.   Instr  ::= "DROP" ;

DInt.   Data         ::= Int ;
CInt.   CType        ::= "int" ;

and testfile test_contract.tz:

DROP;
ADD;
DROP;
PUSH int -5;
PUSH int 1;

and execution with

bnfc --ocaml-menhir -m -o test test.cf && make -C test
`./ocaml_backend/TestMichelson test_contract.tz

Metadata

Metadata

Assignees

Labels

Ocaml/MenhirbugparserIssues concerning parser generatingpositionConcerning position information in parsed ASTtestConcerning the generated test program

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions