Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005765OCamlOCaml tools (ocaml{lex,yacc,dep,browser})public2012-09-23 11:082012-09-29 22:25
ReporterMartin Jambon 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusconfirmedResolutionopen 
PlatformOSOS Version
Product Version4.00.0 
Target Version4.00.2+devFixed in Version 
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 (manager)
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

- 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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker