| Anonymous | Login | Signup for a new account | 2013-06-20 03:58 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||
| 0005374 | OCaml | Camlp4 | public | 2011-10-12 03:09 | 2012-09-25 20:07 | |||
| Reporter | furuse | |||||||
| Assigned To | xclerc | |||||||
| Priority | normal | Severity | major | Reproducibility | always | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Product Version | 3.12.1 | |||||||
| Target Version | Fixed in Version | 3.12.1+dev | ||||||
| Summary | 0005374: camlp4 creates wrong location for type definitions | |||||||
| Description | Camlp4 creates an AST with a wrong location information of the following simple type definition: ----------- p4bug.ml type t ----------- ocamlc -pp camlp4o -c p4bug.ml The type declaration is at line 2, characters 0--1 , which is just after the real location, where nothing exists. It should be line 1, characters 0-5 or something around it. (This issue is one of the causes of wrong location information in CamlSpotter.) | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0006160) furuse (reporter) 2011-10-12 08:55 |
The following patch seems to fix the issue, but not sure. Please review: diff -r 2aa557dc10ec -r 6c3e3f09464f camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml --- a/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml Sat Oct 08 15:55:45 2011 +0900 +++ b/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml Wed Oct 12 15:52:35 2011 +0900 @@ -346,7 +346,7 @@ mktype loc tl cl Ptype_abstract (mkprivate' pflag) m ] ; - value type_decl tl cl t = type_decl tl cl (loc_of_ctyp t) None False t; + value type_decl tl cl t loc = type_decl tl cl loc None False t; value mkvalue_desc t p = {pval_type = ctyp t; pval_prim = p}; @@ -835,7 +835,7 @@ match x with [ <:ctyp< $x$ and $y$ >> -> mktype_decl x (mktype_decl y acc) - | Ast.TyDcl _ c tl td cl -> + | Ast.TyDcl _loc c tl td cl -> let cl = List.map (fun (t1, t2) -> @@ -843,7 +843,7 @@ (ctyp t1, ctyp t2, mkloc loc)) cl in - [(c, type_decl (List.fold_right type_parameters tl []) cl td) :: acc] + [(c, type_decl (List.fold_right type_parameters tl []) cl td _loc) :: acc] | _ -> assert False ] and module_type = fun diff -r 2aa557dc10ec -r 6c3e3f09464f camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml --- a/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml Sat Oct 08 15:55:45 2011 +0900 +++ b/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml Wed Oct 12 15:52:35 2011 +0900 @@ -1004,7 +1004,7 @@ ; opt_eq_ctyp: [ [ "="; tk = type_kind -> tk - | -> <:ctyp<>> ] ] + | -> let _loc = Loc.ghost in <:ctyp<>> ] ] ; type_kind: [ [ t = ctyp -> t ] ] |
|
(0006422) dim (developer) 2011-12-20 18:45 |
Patch reviewed and applied. Thanks. Commits 11901 and 11903. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2011-10-12 03:09 | furuse | New Issue | |
| 2011-10-12 03:09 | furuse | Status | new => assigned |
| 2011-10-12 03:09 | furuse | Assigned To | => ertai |
| 2011-10-12 08:55 | furuse | Note Added: 0006160 | |
| 2011-10-26 08:31 | ertai | Assigned To | ertai => xclerc |
| 2011-12-20 18:45 | dim | Note Added: 0006422 | |
| 2011-12-20 18:46 | dim | Status | assigned => resolved |
| 2011-12-20 18:46 | dim | Resolution | open => fixed |
| 2011-12-20 18:46 | dim | Fixed in Version | => 3.12.1+dev |
| 2012-09-25 20:07 | xleroy | Status | resolved => closed |
| Copyright © 2000 - 2011 MantisBT Group |