Commit 6e1fe134 authored by Andrei Paskevich's avatar Andrei Paskevich

Driver_lexer: better follow the lexing rules

parent 295cacf4
...@@ -59,7 +59,8 @@ ...@@ -59,7 +59,8 @@
let space = [' ' '\t' '\r'] let space = [' ' '\t' '\r']
let alpha = ['a'-'z' 'A'-'Z' '_'] let alpha = ['a'-'z' 'A'-'Z' '_']
let digit = ['0'-'9'] let digit = ['0'-'9']
let ident = alpha (alpha | digit | '\'')* let idsuf = alpha | digit | '\''
let ident = alpha idsuf*
let op_char = ['=' '<' '>' '~' '+' '-' '*' '/' '%' '\\' let op_char = ['=' '<' '>' '~' '+' '-' '*' '/' '%' '\\'
'!' '$' '&' '?' '@' '^' '.' ':' '|' '#'] '!' '$' '&' '?' '@' '^' '.' ':' '|' '#']
...@@ -99,7 +100,7 @@ rule token = parse ...@@ -99,7 +100,7 @@ rule token = parse
{ QUOTE } { QUOTE }
| "]" ("'"+ as s) | "]" ("'"+ as s)
{ RIGHTSQ_QUOTE s } { RIGHTSQ_QUOTE s }
| ")" (['\'' '_'] ident as s) | ")" (['\'' '_'] ['a'-'z' 'A'-'Z'] idsuf* as s)
{ RIGHTPAR_QUOTE s } { RIGHTPAR_QUOTE s }
| op_char+ "'"* as op | op_char+ "'"* as op
{ OPERATOR op } { OPERATOR op }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment