let QSTR = [^ '"' '\\']+
rule comm_token = parse
- | "*)" { query_token lexbuf }
- | [^ '*']* { comm_token lexbuf }
+ | "(*" { comm_token lexbuf; comm_token lexbuf }
+ | "*)" { () }
+ | ['*' '('] { comm_token lexbuf }
+ | [^ '*' '(']* { comm_token lexbuf }
and string_token = parse
| '"' { DQ }
| '\\' _ { STR (String.sub (Lexing.lexeme lexbuf) 1 1) }
| QSTR { STR (Lexing.lexeme lexbuf) }
| eof { EOF }
and query_token = parse
- | "(*" { comm_token lexbuf }
+ | "(*" { comm_token lexbuf; query_token lexbuf }
| SPC { query_token lexbuf }
| '"' { let str = qstr string_token lexbuf in
out ("STR " ^ str); STR str }
| LET vvar BE val_exp IN set_exp { MathQL.LetVVar ($2, $4, $6) }
;
query:
- | set_exp EOF { $1 }
+ | set_exp { $1 }
+ | set_exp error { $1 }
+ | EOF { raise End_of_file }
;
attr:
| vvar IS strs { (path_of_vvar $1, $3) }
| { [] }
;
result:
- | resources EOF { $1 }
+ | resources { $1 }
+ | EOF { raise End_of_file }