git.annexia.org
/
goals.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
parser: Optional semicolon between statements.
[goals.git]
/
src
/
lexer.mll
diff --git
a/src/lexer.mll
b/src/lexer.mll
index
617c10f
..
f2d0830
100644
(file)
--- 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 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
rule read =
parse
@@
-43,6
+43,7
@@
rule read =
| newline { new_line lexbuf; read lexbuf }
| "," { COMMA }
| ":" { COLON }
| newline { new_line lexbuf; read lexbuf }
| "," { COMMA }
| ":" { COLON }
+ | ";" { SEMICOLON }
| "=" { EQUALS }
| "(" { LEFT_PAREN }
| ")" { RIGHT_PAREN }
| "=" { EQUALS }
| "(" { LEFT_PAREN }
| ")" { RIGHT_PAREN }
@@
-54,6
+55,7
@@
rule read =
| "tactic" { TACTIC_KEYWORD }
| "let" { LET }
| "include" { INCLUDE }
| "tactic" { TACTIC_KEYWORD }
| "let" { LET }
| "include" { INCLUDE }
+ | "-include" { OPTINCLUDE }
| "*" id { (* NB: The initial '*' is part of the name. *)
TACTIC (Lexing.lexeme lexbuf) }
| id { ID (Lexing.lexeme lexbuf) }
| "*" id { (* NB: The initial '*' is part of the name. *)
TACTIC (Lexing.lexeme lexbuf) }
| id { ID (Lexing.lexeme lexbuf) }
@@
-106,7
+108,8
@@
and read_string buf =
*)
and read_code buf level =
parse
*)
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 (
| '}' { decr level;
if !level = 0 then CODE (Ast.Substs.get buf)
else (