Commit 7221f53f authored by Bruno Guillaume's avatar Bruno Guillaume

Fix #21581 (gforge): Doublons dans les noms de règle non détectés

parent a612bbc7
......@@ -124,8 +124,7 @@ module Loader = struct
r.Ast.rule_id (Loc.to_string r.Ast.rule_loc) (Loc.to_string loc)
end;
check_grs tail
| New_ast.Strategy (loc, name, _) :: tail
| New_ast.Package (loc, name, _) :: tail ->
| New_ast.Strategy (loc, name, _) :: tail ->
begin
match check_duplicate_id name tail with
| None -> ()
......@@ -133,6 +132,15 @@ module Loader = struct
name (Loc.to_string loc) (Loc.to_string loc2)
end;
check_grs tail
| New_ast.Package (loc, name, sub) :: tail ->
begin
match check_duplicate_id name tail with
| None -> ()
| Some loc2 -> Error.build "Identifier \"%s\" is used twice in the same package (%s and %s)"
name (Loc.to_string loc) (Loc.to_string loc2)
end;
check_grs sub;
check_grs tail
| _ :: tail -> check_grs tail
let real_dir file =
......
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