139
139
let bind x y = () in
140
140
let option_default = () in
141
141
let donothing r k e = k e in
142
let mcode (_,_,info,mcodekind,_) =
142
let mcode (_,_,info,mcodekind,_,_) =
143
143
match mcodekind with
144
144
Ast0.PLUS -> insert info.Ast0.pos_info.Ast0.line_start
228
228
let option_default = (*Bind(Neutral,[],[],[],[],[])*)
229
229
Recursor(Neutral,[],[],[])
231
let mcode (_,_,info,mcodekind,pos) =
231
let mcode (_,_,info,mcodekind,pos,_) =
232
232
let offset = info.Ast0.pos_info.Ast0.offset in
233
233
match mcodekind with
234
234
Ast0.MINUS(_) -> Token(AllMarked,offset,mcodekind,[])
236
236
| Ast0.CONTEXT(_) -> Token(NotAllMarked,offset,mcodekind,[offset])
237
237
| _ -> failwith "not possible"
239
let neutral_mcode (_,_,info,mcodekind,pos) =
239
let neutral_mcode (_,_,info,mcodekind,pos,_) =
240
240
let offset = info.Ast0.pos_info.Ast0.offset in
241
241
match mcodekind with
242
242
Ast0.MINUS(_) -> Token(Neutral,offset,mcodekind,[])
247
247
(* neutral for context; used for mcode in bef aft nodes that don't represent
248
248
anything if they don't contain some information *)
249
let nc_mcode (_,_,info,mcodekind,pos) =
249
let nc_mcode (_,_,info,mcodekind,pos,_) =
250
250
let offset = info.Ast0.pos_info.Ast0.offset in
251
251
match mcodekind with
252
252
Ast0.MINUS(_) -> Token(AllMarked,offset,mcodekind,[])
403
403
(* cases for everything with extra mcode *)
404
404
| Ast0.FunDecl((info,bef),_,_,_,_,_,_,_,_)
405
405
| Ast0.Decl((info,bef),_) ->
406
bind (nc_mcode ((),(),info,bef,())) (k s)
406
bind (nc_mcode ((),(),info,bef,(),-1)) (k s)
407
407
| Ast0.IfThen(_,_,_,_,_,(info,aft))
408
408
| Ast0.IfThenElse(_,_,_,_,_,_,_,(info,aft))
409
409
| Ast0.Iterator(_,_,_,_,_,(info,aft))
410
410
| Ast0.While(_,_,_,_,_,(info,aft))
411
411
| Ast0.For(_,_,_,_,_,_,_,_,_,(info,aft)) ->
412
bind (k s) (nc_mcode ((),(),info,aft,()))
412
bind (k s) (nc_mcode ((),(),info,aft,(),-1))
433
433
(* this is just a sanity check - really only need to look at the top-level
435
let equal_mcode (_,_,info1,_,_) (_,_,info2,_,_) =
435
let equal_mcode (_,_,info1,_,_,_) (_,_,info2,_,_,_) =
436
436
info1.Ast0.pos_info.Ast0.offset = info2.Ast0.pos_info.Ast0.offset
438
438
let equal_option e1 e2 =