Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004200OCaml~DO NOT USE (was: OCaml general)public2007-01-27 13:222009-03-31 13:02
Assigned Tomaranget 
PlatformOSOS Version
Product Version3.09.3 
Target VersionFixed in Version3.10.0 
Summary0004200: Incorrect source file reference for OCaml warning Y (unused variable name) with ocamllex
DescriptionIf you bind a portion of a matched regular expression to a variable (e.g. [^ 'a'-'z' ]+ as name) and then don't use it in the lexer action block ({...}) then ocamlc issues Warning Y (by default) when you compile the .ml file.
The line number and file given for this warning refer to the ocamllex-compiled ML file and not to the actual source .mll file as other errors and warnings do.
ocamllex should insert additional # statements in the ML file before each "let foo = Lexing.sub_lexeme ..." line in its ML output.
Additional InformationOf course, just inserting # {line} "{file}.mll" still means that the character reference number would be wrong, though I'm sure that some trickery with whitespace can be done to engineer the variable name in the ML file being at the same place as in the .mll file to fix this too!

Definitely a cosmetic change, though...
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
maranget (manager)
2007-01-29 17:44

Arguably this is a bug, or at least a misfeature.

Thank you for reporting it.

I have modified ocamllex so as to yield source (.mll) locations
for variables that are bound with 'as'.

Committed in 3.10 branch.


- Issue History
Date Modified Username Field Change
2007-01-27 13:22 dra New Issue
2007-01-29 11:38 maranget Assigned To => maranget
2007-01-29 11:38 maranget Status new => assigned
2007-01-29 17:44 maranget Note Added: 0003903
2007-01-29 17:45 maranget Status assigned => resolved
2007-01-29 17:45 maranget Resolution open => fixed
2009-03-31 13:02 xleroy Status resolved => closed
2009-03-31 13:02 xleroy Fixed in Version => 3.10.0
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker