From: Ferruccio Guidi Date: Wed, 23 Apr 2003 16:47:55 +0000 (+0000) Subject: patch X-Git-Tag: before_refactoring~4 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=5b08f1c5c65ca3c2929a7800742e10308cc0dd8a;p=helm.git patch --- diff --git a/helm/ocaml/mathql/mQueryTLexer.mll b/helm/ocaml/mathql/mQueryTLexer.mll index 770f4d86d..f677ef688 100644 --- a/helm/ocaml/mathql/mQueryTLexer.mll +++ b/helm/ocaml/mathql/mQueryTLexer.mll @@ -48,15 +48,17 @@ let IDEN = ALPHA (NUM | ALPHA)* 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 } diff --git a/helm/ocaml/mathql/mQueryTParser.mly b/helm/ocaml/mathql/mQueryTParser.mly index 1ebadd29a..390c214b4 100644 --- a/helm/ocaml/mathql/mQueryTParser.mly +++ b/helm/ocaml/mathql/mQueryTParser.mly @@ -172,7 +172,9 @@ | 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) } @@ -199,4 +201,5 @@ | { [] } ; result: - | resources EOF { $1 } + | resources { $1 } + | EOF { raise End_of_file } diff --git a/helm/ocaml/mathql_test/.cvsignore b/helm/ocaml/mathql_test/.cvsignore index fa6e35041..bf48dbb5b 100644 --- a/helm/ocaml/mathql_test/.cvsignore +++ b/helm/ocaml/mathql_test/.cvsignore @@ -1 +1 @@ -*.cm[aiox] *.cmxa *.opt mqtop mqitop +*.cm[aiox] *.cmxa *.opt mqtop mqitop examples