Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006177OCamlfor Camlp4 use 22:002014-05-25 20:00
Assigned Tohongboz 
PlatformOSOS Version
Product Version4.01.0 
Target VersionlaterFixed in Version 
Summary0006177: Identifier location inside anti-quotes is wrong.
DescriptionCompile the following by ocamlc -c -I +camlp4 -pp camlp4of :
(* *)
open Camlp4
open PreCast
open Ast

let _loc = Loc.ghost

let _ = <:expr< $hello$ >>
It reports an error:

File "", line 8, characters 16-21:
Error: Unbound value hello

and this position line 8, char 16-21 is one char left from the correct position of the identifier hello. It is not a big issue but exists for years.

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
furuse (reporter)
2013-09-17 06:27

I think it is not limited to identifiers but true for general expressions.
hongboz (developer)
2013-09-17 17:07

I don't have time to look into the problem so far, but I think it's a known issue in Camlp4. The problem lies in all the Ant variants in Camlp4Ast only carries string.
For example:
BAnt of string
ReAnt of string
For a single identifier $xx, the location could be correct, but for a general expression it would be hard.
By the way, my branch of Camlp4, Fan solves the problem in this way.

type ant = `Ant of (loc * content)

The type ant is attached to each node types

- Issue History
Date Modified Username Field Change
2013-09-13 22:00 furuse New Issue
2013-09-15 15:54 hongboz Assigned To => hongboz
2013-09-15 15:54 hongboz Severity major => minor
2013-09-15 15:54 hongboz Status new => assigned
2013-09-17 06:27 furuse Note Added: 0010362
2013-09-17 17:07 hongboz Note Added: 0010371
2014-05-25 20:00 doligez Target Version => later
2016-02-08 12:49 doligez Category Camlp4 => for Camlp4 use [^]
2016-02-08 12:50 doligez Category for Camlp4 use [^] => for Camlp4 use [^]

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker