Commit 8c8e3816 authored by bguillaum's avatar bguillaum

more error localization

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/semagramme/libcaml-grew/trunk@7797 7838e531-6607-4d57-9587-6c381814729c
parent 7ee5de12
......@@ -67,7 +67,7 @@ module Command = struct
match ast_command with
| (Ast.Del_edge_expl (i, j, lab), loc) ->
check_node loc i kni; check_node loc j kni;
let edge = G_edge.make ~locals lab in
let edge = G_edge.make ~loc ~locals lab in
((DEL_EDGE_EXPL (get_pid i, get_pid j, edge), loc), (kni, kei))
| (Ast.Del_edge_name id, loc) ->
......@@ -76,7 +76,7 @@ module Command = struct
| (Ast.Add_edge (i, j, lab), loc) ->
check_node loc i kni; check_node loc j kni;
let edge = G_edge.make ~locals lab in
let edge = G_edge.make ~loc ~locals lab in
((ADD_EDGE (get_pid i, get_pid j, edge), loc), (kni, kei))
| (Ast.Shift_edge (i, j), loc) ->
......@@ -99,7 +99,7 @@ module Command = struct
check_node loc ancestor kni;
if List.mem name_created kni
then Error.build ~loc "Node identifier \"%s\" is already used" name_created;
let edge = G_edge.make ~locals label in
let edge = G_edge.make ~loc ~locals label in
begin
try
(
......
......@@ -123,9 +123,9 @@ module P_edge = struct
let get_id t = t.id
let make ?(id=None) ?(neg=false) ?(locals=[||]) = function
| l when neg -> {id=id; u_label=Neg (List.sort compare (List.map (Label.from_string ~locals) l))}
| l -> {id=id; u_label=Pos (List.sort compare (List.map (Label.from_string ~locals) l))}
let make ?loc ?(id=None) ?(neg=false) ?(locals=[||]) = function
| l when neg -> {id=id; u_label=Neg (List.sort compare (List.map (Label.from_string ?loc ~locals) l))}
| l -> {id=id; u_label=Pos (List.sort compare (List.map (Label.from_string ?loc ~locals) l))}
let build ?locals (ast_edge, loc) =
{ id = ast_edge.Ast.edge_id;
......
......@@ -51,11 +51,12 @@ module P_edge: sig
val build: ?locals:Label.decl array -> Ast.edge -> t
val make:
?id: string option ->
?neg:bool ->
?locals:Label.decl array ->
string list ->
t
?loc:Loc.t ->
?id: string option ->
?neg:bool ->
?locals:Label.decl array ->
string list ->
t
val compatible: t -> G_edge.t -> bool
......
......@@ -90,11 +90,11 @@ module Rule = struct
let pid_of_name loc node_name = Pid.Pos (Id.build ~loc node_name pos_table) in
match const with
| (Ast.Start (node_name, labels), loc) ->
Cst_out (pid_of_name loc node_name, P_edge.make ?locals labels)
Cst_out (pid_of_name loc node_name, P_edge.make ~loc ?locals labels)
| (Ast.Cst_out node_name, loc) ->
Cst_out (pid_of_name loc node_name, P_edge.all)
| (Ast.End (node_name, labels),loc) ->
Cst_in (pid_of_name loc node_name, P_edge.make ?locals labels)
Cst_in (pid_of_name loc node_name, P_edge.make ~loc ?locals labels)
| (Ast.Cst_in node_name, loc) ->
Cst_in (pid_of_name loc node_name, P_edge.all)
| (Ast.Feature_eq ((node_name1, feat_name1), (node_name2, feat_name2)), loc) ->
......@@ -128,11 +128,11 @@ module Rule = struct
| None -> Pid.Neg (Id.build ~loc node_name neg_table) in
match const with
| (Ast.Start (node_name, labels),loc) ->
Cst_out (pid_of_name loc node_name, P_edge.make ?locals labels)
Cst_out (pid_of_name loc node_name, P_edge.make ~loc ?locals labels)
| (Ast.Cst_out node_name, loc) ->
Cst_out (pid_of_name loc node_name, P_edge.all)
| (Ast.End (node_name, labels),loc) ->
Cst_in (pid_of_name loc node_name, P_edge.make ?locals labels)
Cst_in (pid_of_name loc node_name, P_edge.make ~loc ?locals labels)
| (Ast.Cst_in node_name, loc) ->
Cst_in (pid_of_name loc node_name, P_edge.all)
| (Ast.Feature_eq ((node_name1, feat_name1), (node_name2, feat_name2)), loc) ->
......
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