Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005387OCamlCamlp4public2011-10-26 02:402013-08-31 12:44
Reporterfuruse 
Assigned Todim 
PrioritynormalSeveritytweakReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.12.1 
Target VersionFixed in Version3.12.1+dev 
Summary0005387: str_item and other syntactic elements with Nils are not very usable
Description<:str_item< let x = 1 >> currently represents the following data structure:

  Ast.StSem (_loc,
    (Ast.StVal (_loc, Ast.ReNil,
       (Ast.BiEq (_loc, (Ast.PaId (_loc, (Ast.IdLid (_loc, "x")))),
          (Ast.ExInt (_loc, "1")))))),
    (Ast.StNil _loc))
 
The phrase is not parsed as one str_item but a list of str_items. This makes it impossible to use <:str_item< .. >> as a constructor/pattern for one single str_item.

I do not know what is the best solution, but Jake Donham has seen the same issue and written a nice blog entry. It contains a workaround: http://ambassadortothecomputers.blogspot.com/2010/03/reading-camlp4-part-5-filters.html [^]
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0006184)
furuse (reporter)
2011-10-26 03:41

Some more info. For example, the following pattern

  function
    | <:str_item< module $modname$ = struct $sitems$ end >> -> ...

never matches with code like:

    module M = struct ... end

Since the former is StSem(.., StNil ..) but the latter lacks StNil.
(0006594)
dim (developer)
2012-01-05 10:47

Fixed for str_item, sig_item, class_str_item and class_sig_item.

Now Ast.*Nil is not added when the quotation contains only one item.

Commits 11985, 11986, 11987 and 11988.

- Issue History
Date Modified Username Field Change
2011-10-26 02:40 furuse New Issue
2011-10-26 02:40 furuse Status new => assigned
2011-10-26 02:40 furuse Assigned To => ertai
2011-10-26 03:41 furuse Note Added: 0006184
2011-10-26 08:41 ertai Assigned To ertai => xclerc
2012-01-05 10:47 dim Note Added: 0006594
2012-01-05 10:47 dim Assigned To xclerc => dim
2012-01-05 10:47 dim Status assigned => resolved
2012-01-05 10:47 dim Resolution open => fixed
2012-01-05 10:47 dim Fixed in Version => 3.12.1+dev
2013-08-31 12:44 xleroy Status resolved => closed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker