(*
-* 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.
+ *)
type marker =
amarker file line (col + String.length str);
Ast_cocci.MINUS(pos,inst,adj,repl))
| Ast_cocci.CONTEXT(pos,Ast_cocci.NOTHING) -> mck
- | Ast_cocci.CONTEXT(pos,Ast_cocci.BEFORE(bef)) ->
+ | Ast_cocci.CONTEXT(pos,Ast_cocci.BEFORE(bef,c)) ->
(match extract_sgrep_marker bef with
(NoMark,_) -> mck
| (BefMark(marker),[]) ->
| (BefMark(marker),bef) ->
Printf.printf "Match on line %s starting at %s: line %d offset %d\n"
marker file line col;
- Ast_cocci.CONTEXT(pos,Ast_cocci.BEFORE(bef))
+ Ast_cocci.CONTEXT(pos,Ast_cocci.BEFORE(bef,c))
| _ -> failwith "after not possible")
- | Ast_cocci.CONTEXT(pos,Ast_cocci.AFTER(aft)) ->
+ | Ast_cocci.CONTEXT(pos,Ast_cocci.AFTER(aft,c)) ->
(match extract_sgrep_marker aft with
(NoMark,_) -> mck
| (AftMark(marker),[]) ->
| (AftMark(marker),aft) ->
Printf.printf "Match on line %s ending at %s: line %d offset %d\n"
marker file line (col + String.length str);
- Ast_cocci.CONTEXT(pos,Ast_cocci.AFTER(aft))
+ Ast_cocci.CONTEXT(pos,Ast_cocci.AFTER(aft,c))
| _ -> failwith "before not possible")
- | Ast_cocci.CONTEXT(pos,Ast_cocci.BEFOREAFTER(bef,aft)) ->
+ | Ast_cocci.CONTEXT(pos,Ast_cocci.BEFOREAFTER(bef,aft,c)) ->
(match extract_sgrep_marker bef with
(NoMark,_) ->
(match extract_sgrep_marker aft with
Printf.printf
"Match on line %s ending at %s: line %d offset %d\n"
marker file line (col + String.length str);
- Ast_cocci.CONTEXT(pos,Ast_cocci.BEFORE(bef))
+ Ast_cocci.CONTEXT(pos,Ast_cocci.BEFORE(bef,c))
| (AftMark(marker),aft) ->
Printf.printf
"Match on line %s ending at %s: line %d offset %d\n"
marker file line (col + String.length str);
- Ast_cocci.CONTEXT(pos,Ast_cocci.BEFOREAFTER(bef,aft))
+ Ast_cocci.CONTEXT(pos,Ast_cocci.BEFOREAFTER(bef,aft,c))
| _ -> failwith "before not possible")
| (BefMark(marker),[]) ->
Printf.printf "Match on line %s starting at %s: line %d offset %d\n"
marker file line col;
(match extract_sgrep_marker aft with
- (NoMark,_) -> Ast_cocci.CONTEXT(pos,Ast_cocci.AFTER(aft))
+ (NoMark,_) -> Ast_cocci.CONTEXT(pos,Ast_cocci.AFTER(aft,c))
| (AftMark(marker),[]) ->
Printf.printf
"Match on line %s ending at %s: line %d offset %d\n"
Printf.printf
"Match on line %s ending at %s: line %d offset %d\n"
marker file line (col + String.length str);
- Ast_cocci.CONTEXT(pos,Ast_cocci.AFTER(aft))
+ Ast_cocci.CONTEXT(pos,Ast_cocci.AFTER(aft,c))
| _ -> failwith "before not possible")
| (BefMark(marker),bef) ->
Printf.printf "Match on line %s starting at %s: line %d offset %d\n"
marker file line col;
(match extract_sgrep_marker aft with
(NoMark,_) ->
- Ast_cocci.CONTEXT(pos,Ast_cocci.BEFOREAFTER(bef,aft))
+ Ast_cocci.CONTEXT(pos,Ast_cocci.BEFOREAFTER(bef,aft,c))
| (AftMark(marker),[]) ->
Printf.printf
"Match on line %s ending at %s: line %d offset %d\n"
marker file line (col + String.length str);
- Ast_cocci.CONTEXT(pos,Ast_cocci.BEFORE(bef))
+ Ast_cocci.CONTEXT(pos,Ast_cocci.BEFORE(bef,c))
| (AftMark(marker),aft) ->
Printf.printf
"Match on line %s ending at %s: line %d offset %d\n"
marker file line (col + String.length str);
- Ast_cocci.CONTEXT(pos,Ast_cocci.BEFOREAFTER(bef,aft))
+ Ast_cocci.CONTEXT(pos,Ast_cocci.BEFOREAFTER(bef,aft,c))
| _ -> failwith "before not possible")
| _ -> failwith "after not possible")
| _ -> failwith "unexpected plus code"