X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Flexer.mll;h=66c6b9feef221ef2b0d22b58c5a52123222ed972;hb=976bb1b35d77f3058df3c25c1e2a4767147d606b;hp=617c10fe6f45aa372eef945ddfc80c8cc29fccd8;hpb=6afdc65fcdb592dccb751849f65b1f482ef97cd6;p=goals.git diff --git a/src/lexer.mll b/src/lexer.mll index 617c10f..66c6b9f 100644 --- a/src/lexer.mll +++ b/src/lexer.mll @@ -34,7 +34,7 @@ let new_line lexbuf = 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 @@ -43,6 +43,7 @@ rule read = | newline { new_line lexbuf; read lexbuf } | "," { COMMA } | ":" { COLON } + | ";" { SEMICOLON } | "=" { EQUALS } | "(" { LEFT_PAREN } | ")" { RIGHT_PAREN } @@ -51,9 +52,15 @@ rule read = | '"' { read_string (Ast.Substs.create ()) lexbuf } | "{" { read_code (Ast.Substs.create ()) (ref 1) lexbuf } | "goal" { GOAL } - | "tactic" { TACTIC_KEYWORD } + | "tactic" + { TACTIC_KEYWORD } + | "function" + { FUNCTION } | "let" { LET } - | "include" { INCLUDE } + | "include" + { INCLUDE } + | "-include" + { OPTINCLUDE } | "*" id { (* NB: The initial '*' is part of the name. *) TACTIC (Lexing.lexeme lexbuf) } | id { ID (Lexing.lexeme lexbuf) } @@ -106,7 +113,8 @@ and read_string buf = *) 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 (