| Anonymous | Login | Signup for a new account | 2013-06-19 19:05 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 | ||||||
| 0005705 | OCaml | Camlp4 | public | 2012-07-29 17:45 | 2012-09-24 00:12 | ||||||
| Reporter | mottl | ||||||||||
| Assigned To | |||||||||||
| Priority | normal | Severity | minor | Reproducibility | always | ||||||
| Status | confirmed | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | 4.00.0 | ||||||||||
| Target Version | 4.00.2+dev | Fixed in Version | |||||||||
| Summary | 0005705: Camlp4 accepts bad syntax and may also bomb on it | ||||||||||
| Description | The following file "x.ml" will lead to a syntax error with "ocaml x.ml": let f x : type a. a = () But "camlp4o x.ml" will accept and print the human-readable format. By contrast, "ocamldep -pp camlp4o x.ml" will bomb: Assertion failed, file "camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml", line 284, char 8 Preprocessing error on file x.ml x.cmo : x.cmx : EXIT STATUS 2 | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Notes |
|
|
(0007838) hongboz (developer) 2012-07-31 05:22 |
It's weird (-verbose) will change the semantics of camlp4 parser camlp4>camlp4o -filter lift -str 'let f x : type a . a = () ' let loc = Loc.ghost in Ast.StVal (loc, Ast.ReNil, (Ast.BiEq (loc, (Ast.PaId (loc, (Ast.IdLid (loc, "f")))), (Ast.ExFun (loc, (Ast.McArr (loc, (Ast.PaId (loc, (Ast.IdLid (loc, "x")))), (Ast.ExNil loc), (Ast.ExTyc (loc, (Ast.ExId (loc, (Ast.IdUid (loc, "()")))), (Ast.TyTypePol (loc, (Ast.TyId (loc, (Ast.IdLid (loc, "a")))), (Ast.TyId (loc, (Ast.IdLid (loc, "a"))))))))))))))) camlp4>camlp4o -verbose -filter lift -str 'let f x : type a . a = () ' ---------------------------------- Parse error in entry [ctyp], rule: [ TRY [ a_LIDENT; ":" ]; ctyp LEVEL "star"; "->"; SELF ] ---------------------------------- let loc = Loc.ghost in Ast.StVal (loc, Ast.ReNil, (Ast.BiEq (loc, (Ast.PaId (loc, (Ast.IdLid (loc, "f")))), (Ast.ExFun (loc, (Ast.McArr (loc, (Ast.PaId (loc, (Ast.IdLid (loc, "x")))), (Ast.ExNil loc), (Ast.ExTyc (loc, (Ast.ExId (loc, (Ast.IdUid (loc, "()")))), (Ast.TyTypePol (loc, (Ast.TyId (loc, (Ast.IdLid (loc, "a")))), (Ast.TyId (loc, (Ast.IdLid (loc, "a"))))))))))))))) |
|
(0008148) hongboz (developer) 2012-09-24 00:12 |
the problem comes from the entry cvalue_binding cvalue_binding: | ":"; "type"; t1 = unquoted_typevars; "." ; t2 = ctyp ; "="; e = expr -> let u = Ast.TyTypePol _loc t1 t2 in <:expr< ($e : $u) >> The parser goes from binding -> fun_binding -> cvalue_binding. Would it be safe to delete this rule? cvalue_binding is invoked in another place | o = value_val_opt_override; mf = opt_mutable; lab = label; e = cvalue_binding -> <:class_str_item< value $override:o $mutable:mf $lab = $e >> |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-07-29 17:45 | mottl | New Issue | |
| 2012-07-31 05:22 | hongboz | Note Added: 0007838 | |
| 2012-07-31 13:25 | doligez | Status | new => confirmed |
| 2012-07-31 13:25 | doligez | Target Version | => 4.00.1+dev |
| 2012-07-31 16:55 | doligez | Severity | major => minor |
| 2012-09-21 14:55 | doligez | Target Version | 4.00.1+dev => 4.00.2+dev |
| 2012-09-24 00:12 | hongboz | Note Added: 0008148 | |
| Copyright © 2000 - 2011 MantisBT Group |