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: 5765 Reporter:@mjambon Status: closed (set by @damiendoligez on 2013-07-11T15:51:40Z) Resolution: fixed Priority: normal Severity: minor Version: 4.00.0 Target version: 4.01.0+dev Fixed in version: 4.01.0+dev Category: tools (ocaml{lex,yacc,dep,debug,...})
Bug description
When ocamllex encounters a line directive in its input, it does not take it into account when outputting new line directives.
This is problematic for ocamllex files that are generated from a template or extracted from a larger source file.
Interestingly, errors in the input of ocamllex are reported correctly, obeying line directives.
Steps to reproduce
martin@m1 ~/tmp $ cat toto.mll
100 "toto.mlx"
rule f = parse
'x' { true }
| "" { false }
martin@m1 ~/tmp $ ocamllex -v
The OCaml lexer generator, version 4.00.0
It's even stranger than you think: the line numbers are reported correctly, but not the file name.
Try this:
$ cat toto.mll
100 "toto.mlx"
rule f = parse
'x' { true }
| "" { false+1 }
$ ocamllex toto.mll
2 states, 257 transitions, table size 1040 bytes
$ ocamlc -c toto.ml
File "toto.mll", line 102, characters 7-12:
Error: This expression has type bool but an expression was expected of type
int
Original bug ID: 5765
Reporter: @mjambon
Status: closed (set by @damiendoligez on 2013-07-11T15:51:40Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.00.0
Target version: 4.01.0+dev
Fixed in version: 4.01.0+dev
Category: tools (ocaml{lex,yacc,dep,debug,...})
Bug description
When ocamllex encounters a line directive in its input, it does not take it into account when outputting new line directives.
This is problematic for ocamllex files that are generated from a template or extracted from a larger source file.
Interestingly, errors in the input of ocamllex are reported correctly, obeying line directives.
Steps to reproduce
martin@m1 ~/tmp $ cat toto.mll
100 "toto.mlx"
rule f = parse
'x' { true }
| "" { false }
martin@m1 ~/tmp $ ocamllex -v
The OCaml lexer generator, version 4.00.0
martin@m1 ~/tmp $ ocamllex toto.mll
2 states, 257 transitions, table size 1040 bytes
martin@m1 ~/tmp $ grep mlx toto.ml || echo nope.
nope.
The text was updated successfully, but these errors were encountered: