]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/mathql/mQueryTLexer.mll
textual parser: caml-like comments added (not nestable)
[helm.git] / helm / ocaml / mathql / mQueryTLexer.mll
index 89d62375a24c1730c0a43e2eaa5ee2ff49b9dc18..a0884e79dd21a7a6ec2f23da7380875a6639d4d6 100644 (file)
@@ -43,12 +43,16 @@ let NUM   = ['0'-'9']
 let IDEN  = ALPHA (NUM | ALPHA)*
 let QSTR  = [^ '"' '\\']+
 
-rule string_token = parse
+rule comm_token = parse
+   | "*)"        { query_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 }
    | SPC         { query_token lexbuf }
    | '"'         { STR (qstr string_token lexbuf) }
    | '('         { LP }