~ubuntu-branches/ubuntu/trusty/coccinelle/trusty

« back to all changes in this revision

Viewing changes to parsing_c/ast_c.ml

  • Committer: Package Import Robot
  • Author(s): Євгеній Мещеряков
  • Date: 2012-08-19 20:40:52 UTC
  • mfrom: (7.2.8 experimental)
  • Revision ID: package-import@ubuntu.com-20120819204052-8cujknwy6cn8a6h6
Tags: 1.0.0~rc15.deb-1
* New upstream RC 
  - Do not build-depend on libsexplib-camlp4-dev and libextlib-ocaml-dev
    anymore

Show diffs side-by-side

added added

removed removed

Lines of Context:
466
466
 
467
467
  and exprStatement = expression option
468
468
 
 
469
  and declOrExpr = ForDecl of declaration | ForExp of expression option wrap
 
470
 
469
471
 (* for Switch, need check that all elements in the compound start
470
472
  * with a case:, otherwise unreachable code.
471
473
  *)
477
479
  and iteration     =
478
480
    | While   of expression * statement
479
481
    | DoWhile of statement * expression
480
 
    | For     of exprStatement wrap * exprStatement wrap * exprStatement wrap *
 
482
    | For     of declOrExpr * exprStatement wrap * exprStatement wrap *
481
483
                 statement
482
484
    (* cppext: *)
483
485
    | MacroIteration of string * argument wrap2 list * statement
987
989
let equal_posl (l1,c1) (l2,c2) =
988
990
  (l1 =|= l2) && (c1 =|= c2)
989
991
 
 
992
let compare_posl (l1,c1) (l2,c2) =
 
993
  match l2 - l1 with
 
994
    0 -> c2 - c1
 
995
  | r -> r
 
996
 
990
997
let info_to_fixpos ii =
991
998
  match pinfo_of_info ii with
992
999
    OriginTok pi -> Ast_cocci.Real pi.Common.charpos