(*
-* Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
-* Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller
-* This file is part of Coccinelle.
-*
-* Coccinelle is free software: you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation, according to version 2 of the License.
-*
-* Coccinelle is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with Coccinelle. If not, see <http://www.gnu.org/licenses/>.
-*
-* The authors reserve the right to distribute this or future versions of
-* Coccinelle under other licenses.
-*)
+ * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
+ * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
+ * This file is part of Coccinelle.
+ *
+ * Coccinelle is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, according to version 2 of the License.
+ *
+ * Coccinelle is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Coccinelle. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * The authors reserve the right to distribute this or future versions of
+ * Coccinelle under other licenses.
+ *)
open Format
(function x ->
print_string lb; fn x; print_string rb)
x plus_streams
- | Ast0.PLUS -> print_int (info.Ast0.pos_info.Ast0.column); fn x
+ | Ast0.PLUS _ -> print_int (info.Ast0.pos_info.Ast0.column); fn x
| Ast0.MIXED(plus_streams) ->
let (lb,rb) =
if !quiet
close_box(); mcode print_string rp; print_string " ";
statement arity body;
mcode (function _ -> ()) ((),(),info,aft,ref Ast0.NoMetaPos,-1)
- | Ast0.Switch(switch,lp,exp,rp,lb,cases,rb) ->
+ | Ast0.Switch(switch,lp,exp,rp,lb,decls,cases,rb) ->
print_string arity;
mcode print_string switch; print_string " ";
mcode print_string_box lp; expression exp; close_box();
mcode print_string rp; print_string " "; mcode print_string lb;
+ dots force_newline (statement arity) decls;
dots force_newline (case_line arity) cases;
mcode print_string rb
| Ast0.Break(br,sem) ->
mcode print_string case; print_string " "; expression exp;
mcode print_string colon; print_string " ";
dots force_newline (statement arity) code
+ | Ast0.DisjCase(starter,case_lines,mids,ender) ->
+ print_string "\n("; force_newline();
+ print_between
+ (function _ -> print_string "\n|"; force_newline())
+ (case_line arity) case_lines;
+ print_string "\n)"
| Ast0.OptCase(case) -> case_line "?" case)
and statement_dots l = dots (function _ -> ()) (statement "") l