Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005765OCamlOCaml tools (ocaml{lex,yacc,dep,browser,debug})public2012-09-23 11:082013-07-11 17:51
ReporterMartin Jambon 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version4.00.0 
Target Version4.01.0+devFixed in Version4.01.0+dev 
Summary0005765: ocamllex doesn't preserve line directives
DescriptionWhen 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 Reproducemartin@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.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0008175)
doligez (administrator)
2012-09-29 22:25

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
(0009757)
doligez (administrator)
2013-07-11 17:51

Fixed in 4.01 branch (rev 13887).

- Issue History
Date Modified Username Field Change
2012-09-23 11:08 Martin Jambon New Issue
2012-09-29 22:25 doligez Note Added: 0008175
2012-09-29 22:25 doligez Status new => confirmed
2012-09-29 22:25 doligez Target Version => 4.00.2+dev
2013-07-11 17:51 doligez Note Added: 0009757
2013-07-11 17:51 doligez Status confirmed => closed
2013-07-11 17:51 doligez Resolution open => fixed
2013-07-11 17:51 doligez Fixed in Version => 4.01.0+dev
2013-07-11 17:51 doligez Target Version 4.00.2+dev => 4.01.0+dev
2013-08-19 15:58 doligez Category OCaml tools (ocaml{lex,yacc,dep,browser}) => OCaml tools (ocaml{lex,yacc,dep,browser,debug})


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker