Commit 90fb256c authored by bguillaum's avatar bguillaum

- reset counter for correct line numbers

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/semagramme/libcaml-grew/trunk@6333 7838e531-6607-4d57-9587-6c381814729c
parent a0980a1b
......@@ -86,15 +86,12 @@ gr:
gr_item:
| id = IDENT position = option(delimited(LPAREN,index,RPAREN)) feats = delimited(LBRACKET,separated_list(COMA,node_features),RBRACKET)
(* { Graph_node (id, position, feats,(!Parser_global.current_file, !Parser_global.current_line+1)) } *)
{ Graph_node (localize {node_id = id; position=position; fs=feats}) }
| n1 = IDENT labels = delimited(LTR_EDGE_LEFT_NEG,separated_nonempty_list(PIPE,IDENT),LTR_EDGE_RIGHT) n2 = IDENT
(* { Graph_edge (None, (n1,n2,true,labels),(!Parser_global.current_file,!Parser_global.current_line+1)) } *)
{ Graph_edge (localize {edge_id = None; src=n1; edge_labels=labels; tar=n2; negative=true; }) }
| n1 = IDENT labels = delimited(LTR_EDGE_LEFT,separated_nonempty_list(PIPE,IDENT),LTR_EDGE_RIGHT) n2 = IDENT
(* { Graph_edge (None, (n1,n2,false,labels),(!Parser_global.current_file,!Parser_global.current_line+1)) } *)
{ Graph_edge (localize {edge_id = None; src=n1; edge_labels=labels; tar=n2; negative=false; }) }
index:
......
......@@ -38,6 +38,7 @@ module Grew_parser = struct
begin
try
Parser_global.current_file := file;
Parser_global.current_line := 0;
let res = Gr_grs_parser.grs Lexer.global to_parse in close_in in_ch; res
with
| Lexer.Error msg -> raise (Parse_error msg)
......@@ -77,6 +78,7 @@ module Grew_parser = struct
begin
try
Parser_global.current_file := file;
Parser_global.current_line := 0;
let res = Gr_grs_parser.gr Lexer.global to_parse in close_in in_ch; res
with
| Lexer.Error msg -> raise (Parse_error msg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment