~ubuntu-branches/ubuntu/maverick/coccinelle/maverick

« back to all changes in this revision

Viewing changes to parsing_cocci/context_neg.ml

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2009-09-08 13:06:20 UTC
  • mfrom: (7.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090908130620-s33aehu14xddef4u
Tags: 0.1.10.deb-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - debian/control: build-depend on python2.6-dev,
    set XB-Python-Version to 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
393
393
          k (Ast0.rewrap i (Ast0.Idots(dots,None)))
394
394
      | _ -> k i) in
395
395
 
 
396
  let case_line r k e =
 
397
    compute_result Ast0.case_line e
 
398
      (match Ast0.unwrap e with
 
399
        Ast0.DisjCase(starter,case_list,_,ender) ->
 
400
          disj_cases e starter case_list r.VT0.combiner_rec_case_line ender
 
401
      | _ -> k e) in
 
402
 
396
403
  let statement r k s =
397
404
    compute_result Ast0.stmt s
398
405
      (match Ast0.unwrap s with
430
437
      (do_nothing Ast0.dotsParam) (do_nothing Ast0.dotsStmt)
431
438
      (do_nothing Ast0.dotsDecl) (do_nothing Ast0.dotsCase)
432
439
      (do_nothing Ast0.ident) expression typeC initialiser param declaration
433
 
      statement (do_nothing Ast0.case_line) (do_top Ast0.top) in
 
440
      statement case_line (do_top Ast0.top) in
434
441
  combiner.VT0.combiner_rec_top_level code
435
442
 
436
443
(* --------------------------------------------------------------------- *)
641
648
       equal_mcode rp1 rp2
642
649
  | (Ast0.Iterator(nm1,lp1,_,rp1,_,_),Ast0.Iterator(nm2,lp2,_,rp2,_,_)) ->
643
650
      equal_mcode lp1 lp2 && equal_mcode rp1 rp2
644
 
  | (Ast0.Switch(switch1,lp1,_,rp1,lb1,case1,rb1),
645
 
     Ast0.Switch(switch2,lp2,_,rp2,lb2,case2,rb2)) ->
 
651
  | (Ast0.Switch(switch1,lp1,_,rp1,lb1,_,_,rb1),
 
652
     Ast0.Switch(switch2,lp2,_,rp2,lb2,_,_,rb2)) ->
646
653
       equal_mcode switch1 switch2 && equal_mcode lp1 lp2 &&
647
654
       equal_mcode rp1 rp2 && equal_mcode lb1 lb2 &&
648
655
       equal_mcode rb1 rb2
696
703
      equal_mcode def1 def2 && equal_mcode colon1 colon2
697
704
  | (Ast0.Case(case1,_,colon1,_),Ast0.Case(case2,_,colon2,_)) ->
698
705
      equal_mcode case1 case2 && equal_mcode colon1 colon2
 
706
  | (Ast0.DisjCase(starter1,_,mids1,ender1),
 
707
     Ast0.DisjCase(starter2,_,mids2,ender2)) ->
 
708
       equal_mcode starter1 starter2 &&
 
709
       List.for_all2 equal_mcode mids1 mids2 &&
 
710
       equal_mcode ender1 ender2
699
711
  | (Ast0.OptCase(_),Ast0.OptCase(_)) -> true
700
712
  | _ -> false
701
713