]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/mathql/mQueryTLexer.mll
final ispell
[helm.git] / helm / ocaml / mathql / mQueryTLexer.mll
index 9cc22c2dcbc0d8076ea29124910bc8c248624967..f677ef688e77c3edc2076bb2e9997f607766bddb 100644 (file)
 }
 
 let SPC   = [' ' '\t' '\n']+
-let ALPHA = ['A'-'Z' 'a'-'z']
+let ALPHA = ['A'-'Z' 'a'-'z' '_']
 let NUM   = ['0'-'9']
 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 }