/[svn]/parser/parser.ml
ViewVC logotype

Diff of /parser/parser.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 120 by abate, Tue Jul 10 17:07:51 2007 UTC revision 121 by abate, Tue Jul 10 17:08:00 2007 UTC
# Line 3  Line 3 
3    
4  (* let ()  = Grammar.error_verbose := true *)  (* let ()  = Grammar.error_verbose := true *)
5    
 let gram    = Grammar.gcreate (Lexer.gmake ())  
   
6  let gram    = Grammar.gcreate (Wlexer.lexer Wlexer.token Wlexer.latin1_engine)  let gram    = Grammar.gcreate (Wlexer.lexer Wlexer.token Wlexer.latin1_engine)
7    
8    
# Line 90  Line 88 
88          mk loc (Try (e,b@[default]))          mk loc (Try (e,b@[default]))
89      | "map"; e = SELF; "with"; b = branches -> mk loc (Map (e,b))      | "map"; e = SELF; "with"; b = branches -> mk loc (Map (e,b))
90      | "transform"; e = SELF; "with"; b = branches ->      | "transform"; e = SELF; "with"; b = branches ->
91          mk noloc (Op ("flatten", [mk loc (Map (e,b))]))          let default = mk noloc (Capture "x"), cst_nil in
92            mk loc (Op ("flatten", [mk loc (Map (e,b@[default]))]))
93      | "fun"; (f,a,b) = fun_decl ->      | "fun"; (f,a,b) = fun_decl ->
94          mk loc (Abstraction { fun_name = f; fun_iface = a; fun_body = b })          mk loc (Abstraction { fun_name = f; fun_iface = a; fun_body = b })
95      | (p,e1) = let_binding; "in"; e2 = expr LEVEL "top"->      | (p,e1) = let_binding; "in"; e2 = expr LEVEL "top"->
# Line 241  Line 240 
240              -> mk loc (Recurs (x,b)) ]              -> mk loc (Recurs (x,b)) ]
241      | RIGHTA [ x = pat; "->"; y = pat -> mk loc (Arrow (x,y)) ]      | RIGHTA [ x = pat; "->"; y = pat -> mk loc (Arrow (x,y)) ]
242      | "no_arrow" [ x = pat; "|"; y = pat -> mk loc (Or (x,y)) ]      | "no_arrow" [ x = pat; "|"; y = pat -> mk loc (Or (x,y)) ]
243      | "simple" [ x = pat; "&"; y = pat -> mk loc (And (x,y,true))      | "simple" [ x = pat; "&"; y = pat -> mk loc (And (x,y))
 (*             | x = pat; ":"; y = pat -> mk loc (And (x,y,false))   *)  
244                 | x = pat; "\\"; y = pat -> mk loc (Diff (x,y)) ]                 | x = pat; "\\"; y = pat -> mk loc (Diff (x,y)) ]
245      |      |
246        [ "{"; r = record_spec; "}" -> r        [ "{"; r = record_spec; "}" -> r
# Line 304  Line 302 
302                  ] SEP ";" ->                  ] SEP ";" ->
303          match r with          match r with
304            | [] -> mk loc (Internal Types.Record.any)            | [] -> mk loc (Internal Types.Record.any)
305            | h::t -> List.fold_left (fun t1 t2 -> mk loc (And (t1,t2,true))) h t            | h::t -> List.fold_left (fun t1 t2 -> mk loc (And (t1,t2))) h t
306        ] ];        ] ];
307    
308    char:    char:

Legend:
Removed from v.120  
changed lines
  Added in v.121

CVS Admin">CVS Admin
ViewVC Help
Powered by ViewVC 1.1.5