home
/
code
/
tiger.ml.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove stand-alone fun_call grammar rule
[tiger.ml.git]
/
tiger
/
src
/
lib
/
tiger
/
tiger_lexer.mll
diff --git
a/tiger/src/lib/tiger/tiger_lexer.mll
b/tiger/src/lib/tiger/tiger_lexer.mll
index
86bf0f8
..
359366f
100644
(file)
--- a/
tiger/src/lib/tiger/tiger_lexer.mll
+++ b/
tiger/src/lib/tiger/tiger_lexer.mll
@@
-1,5
+1,5
@@
{
{
- open Tiger_parser
.Token
+ open Tiger_parser
let comment_level = ref 0
let string_buf = Buffer.create 100
let comment_level = ref 0
let string_buf = Buffer.create 100
@@
-10,9
+10,7
@@
let num = ['0'-'9']
let newline = '\n' | '\r' | "\n\r"
rule token = parse
let newline = '\n' | '\r' | "\n\r"
rule token = parse
- | eof {
- EOF
- }
+ | eof {EOF}
(* Track line number *)
| newline {
(* Track line number *)
| newline {
@@
-83,12
+81,7
@@
rule token = parse
| "type" -> TYPE
| "var" -> VAR
| "while" -> WHILE
| "type" -> TYPE
| "var" -> VAR
| "while" -> WHILE
- | _ -> ID id
- }
-
- (* Eat unimplemented. FIXME: stop indiscriminate eating *)
- | _ {
- token lexbuf
+ | _ -> (ID id)
}
and string_literal = parse
(* Keep escaped quote marks as part of the string literal *)
}
and string_literal = parse
(* Keep escaped quote marks as part of the string literal *)
@@
-109,10
+102,8
@@
and string_literal = parse
string_literal lexbuf
}
and comment = parse
string_literal lexbuf
}
and comment = parse
- | eof {
- (* TODO: Error: unterminated comment? or we don't care? *)
- EOF
- }
+ (* TODO: Error: unterminated comment? or we don't care? *)
+ | eof {EOF}
(* Track line number *)
| newline {
(* Track line number *)
| newline {
This page took
0.031042 seconds
and
4
git commands to generate.