Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005861OCamlCamlp4public2012-12-20 18:372013-06-17 16:25
Reporterlpw25 
Assigned Tohongboz 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version4.01.0+dev 
Summary0005861: Camlp4 accepts multiple private keywords
DescriptionBoth camlp4o and camlp4r accept the following:

type foo

type bar = private private foo
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0008636)
hongboz (developer)
2012-12-20 20:14

This is due to strict_parsing in the file Camlp4/Struct/Grammar/Parser.ml is set to false, then the backtracking for lower precedence is automatically turned on.
But I am afraid if it was set to true, it may break other programs
(0008637)
hongboz (developer)
2012-12-20 20:40

I have set strict_parsing to true, and bootstrapped successfully, but it needs to add some parens in some places, I don't know it's worth the change.
I would like to hear other people's opinion
(0008643)
lpw25 (developer)
2012-12-23 15:00

I don't know that much about camlp4, but I was thinking of something more along the lines of:

--- a/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml
+++ b/camlp4/Camlp4/Struct/Camlp4Ast2OCamlAst.ml
@@ -352,7 +352,7 @@ module Make (Ast : Sig.Camlp4Ast) = struct
     fun
     [ <:ctyp< $t1$ == $t2$ >> ->
         type_decl tl cl loc (Some (ctyp t1)) pflag t2
- | <:ctyp< private $t$ >> ->
+ | <:ctyp< private $t$ >> when not pflag ->
         type_decl tl cl loc m True t
     | <:ctyp< { $t$ } >> ->
         mktype loc tl cl
(0008644)
hongboz (developer)
2012-12-23 15:07

@lpw25, you mean delay the parsing error into a dumping error?
(0008645)
lpw25 (developer)
2012-12-23 15:14

Yes. Plenty of syntax errors seem to be dumping errors already, since this is quite an unlikely error I don't see the need to change the parser.
(0008646)
hongboz (developer)
2012-12-23 15:20

It's fair, I will fix it later, thanks
(0008648)
hongboz (developer)
2012-12-24 06:13

fixed in revision 13157

- Issue History
Date Modified Username Field Change
2012-12-20 18:37 lpw25 New Issue
2012-12-20 20:14 hongboz Note Added: 0008636
2012-12-20 20:40 hongboz Note Added: 0008637
2012-12-21 21:49 hongboz Status new => feedback
2012-12-23 15:00 lpw25 Note Added: 0008643
2012-12-23 15:00 lpw25 Status feedback => new
2012-12-23 15:07 hongboz Note Added: 0008644
2012-12-23 15:14 lpw25 Note Added: 0008645
2012-12-23 15:20 hongboz Note Added: 0008646
2012-12-23 15:20 hongboz Assigned To => hongboz
2012-12-23 15:20 hongboz Status new => assigned
2012-12-24 06:13 hongboz Note Added: 0008648
2012-12-24 06:13 hongboz Status assigned => resolved
2013-06-17 16:25 xleroy Resolution open => fixed
2013-06-17 16:25 xleroy Fixed in Version => 4.01.0+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker