let term = CicNotationParser.term
let statement = Grammar.Entry.create grammar "statement"
+let add_raw_attribute ?context ~text term =
+ CicNotationPt.AttributedTerm (`Raw (text, context), term)
+
EXTEND
GLOBAL: term statement;
arg: [
IDENT "for";
p2 =
[ blob = UNPARSED_AST ->
- CicNotationParser.parse_level2_ast (Stream.of_string blob)
+ add_raw_attribute ~context:`Ast ~text:blob
+ (CicNotationParser.parse_level2_ast (Stream.of_string blob))
| blob = UNPARSED_META ->
- CicNotationParser.parse_level2_meta (Stream.of_string blob) ]
- ->
- (CicNotationParser.parse_level1_pattern (Stream.of_string s), assoc, prec, p2)
+ add_raw_attribute ~context:`Meta ~text:blob
+ (CicNotationParser.parse_level2_meta (Stream.of_string blob))
+ ] ->
+ (add_raw_attribute ~text:s
+ (CicNotationParser.parse_level1_pattern (Stream.of_string s)),
+ assoc, prec, p2)
]
];
level3_term: [