let white = [' ' '\t']+
let newline = '\r' | '\n' | "\r\n"
let comment = '#' (_#'\n')*
-let id = ['a'-'z' 'A'-'Z' '_'] ['a'-'z' 'A'-'Z' '0'-'9' '_']*
+let id = ['a'-'z' 'A'-'Z' '_'] ['a'-'z' 'A'-'Z' '0'-'9' '_' '-']*
rule read =
parse
| newline { new_line lexbuf; read lexbuf }
| "," { COMMA }
| ":" { COLON }
+ | ";" { SEMICOLON }
| "=" { EQUALS }
| "(" { LEFT_PAREN }
| ")" { RIGHT_PAREN }
| '"' { read_string (Ast.Substs.create ()) lexbuf }
| "{" { read_code (Ast.Substs.create ()) (ref 1) lexbuf }
| "goal" { GOAL }
+ | "tactic" { TACTIC_KEYWORD }
| "let" { LET }
- | "*" id { let id = Lexing.lexeme lexbuf in
- let len = String.length id in
- TACTIC (String.sub id 1 (len-1)) }
+ | "include" { INCLUDE }
+ | "-include" { OPTINCLUDE }
+ | "*" id { (* NB: The initial '*' is part of the name. *)
+ TACTIC (Lexing.lexeme lexbuf) }
| id { ID (Lexing.lexeme lexbuf) }
| _ { raise (SyntaxError ("unexpected character: " ^
Lexing.lexeme lexbuf)) }
*)
and read_code buf level =
parse
- | '{' { incr level; read_code buf level lexbuf }
+ | '{' { Ast.Substs.add_char buf '{';
+ incr level; read_code buf level lexbuf }
| '}' { decr level;
if !level = 0 then CODE (Ast.Substs.get buf)
else (