' ' '\t' '\n'
'\\' '(' '[' '{' ')' ']' '}' '?'
]
-let regexp comment_char = [^ '\n' ]
-let regexp comment = "%%" comment_char*
+let regexp dust = "%%" [^ '\n']* '\n'
+let regexp comment_char = [^ "*)" ]
+let regexp note = "(*" comment_char* "*)"
+let regexp commentbegin = "(**"
+let regexp commentend = "**)"
let regexp blanks = blank+
let regexp num = digit+
let regexp tex_token = '\\' alpha+
return lexbuf ("SYMBOL", Utf8Macro.expand macro)
with Utf8Macro.Macro_not_found _ ->
return lexbuf ("SYMBOL", Ulexing.utf8_lexeme lexbuf))
- | comment ->
- if comments then
+ | dust -> token comments lexbuf
+ | note ->
+ (*if comments then*)
let comment =
Ulexing.utf8_sub_lexeme lexbuf 2 (Ulexing.lexeme_length lexbuf - 2)
in
- return lexbuf ("COMMENT", comment)
- else
- token comments lexbuf
+ return lexbuf ("NOTE", comment)
+ (*else
+ token comments lexbuf*)
+ | commentbegin -> return lexbuf ("BEGINCOMMENT","")
+ | commentend -> return lexbuf ("ENDCOMMENT","")
| eof -> return lexbuf ("EOI", "")
| _ -> error lexbuf "Invalid character"
| [ IDENT "check" ]; t = term ->
TacticAst.Check (loc, t)
| [ IDENT "hint" ] -> TacticAst.Hint loc
- | [ IDENT "pmatch" ] ; t = term -> TacticAst.Match (loc,t)
- | [ IDENT "instance" ] ; t = term -> TacticAst.Instance (loc,t)
+ | [ IDENT "whelp"; "match" ] ; t = term ->
+ TacticAst.Match (loc,t)
+ | [ IDENT "whelp"; IDENT "instance" ] ; t = term ->
+ TacticAst.Instance (loc,t)
| [ IDENT "print" ]; name = QSTRING -> TacticAst.Print (loc, name)
]];
TacticAst.Alias (loc, spec)
]];
- statement: [
+ executable: [
[ cmd = command; SYMBOL "." -> TacticAst.Command (loc, cmd)
| tac = tactical; SYMBOL "." -> TacticAst.Tactical (loc, tac)
| mac = macro; SYMBOL "." -> TacticAst.Macro (loc, mac)
]
];
+
+ comment: [
+ [ BEGINCOMMENT ; ex = executable ; ENDCOMMENT ->
+ TacticAst.Code (loc, ex)
+ | str = NOTE ->
+ TacticAst.Note (loc, str)
+ ]
+ ];
+
+ statement: [
+ [ ex = executable -> TacticAst.Executable (loc,ex)
+ | com = comment -> TacticAst.Comment (loc, com)
+ ]
+ ];
END
let exc_located_wrapper f =