Commit 5a56a8ff authored by Bruno Guillaume's avatar Bruno Guillaume

Fix global pattern

parent ba61bee7
......@@ -282,13 +282,18 @@ display:
/* RULES DEFINITION */
/*=============================================================================================*/
rule:
| doc=option(COMMENT) RULE id_loc=simple_id_with_loc file_lexicons = option(external_lexicons) LACC p=pos_item n=list(neg_item) cmds=commands RACC final_lexicons=list(final_lexicon)
| doc=option(COMMENT) RULE id_loc=simple_id_with_loc file_lexicons = option(external_lexicons) LACC g=option (glob_decl) p=option(pos_item) n=list(neg_item) cmds=commands RACC final_lexicons=list(final_lexicon)
{
let lexicons = match file_lexicons with
| Some l -> l @ final_lexicons
| None -> final_lexicons in
{ Ast.rule_id = fst id_loc;
pattern = Ast.complete_pattern { Ast.pivot=None; Ast.pat_glob = ["TODO"]; Ast.pat_pos = p; Ast.pat_negs = n };
pattern = Ast.complete_pattern {
Ast.pivot=None;
Ast.pat_glob = (match g with None -> [] | Some x -> x);
Ast.pat_pos = (match p with None -> Ast.empty_basic | Some x -> x);
Ast.pat_negs = n;
}
commands = cmds;
lexicon_info = lexicons;
rule_doc = begin match doc with Some d -> d | None -> [] end;
......
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