X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Fxpath%2Fulexer.ml;h=7a7d2a749cfc107e150af3c6be607a483a04fb35;hb=e381c2bd8da5a33c0fdb1e6cfa9c1800386eafed;hp=2153e18f5fd04277d0c69954b8dae9fa37eaebcd;hpb=e13f5deae217f945b44fa345ef4f0008e1780787;p=tatoo.git diff --git a/src/xpath/ulexer.ml b/src/xpath/ulexer.ml index 2153e18..7a7d2a7 100644 --- a/src/xpath/ulexer.ml +++ b/src/xpath/ulexer.ml @@ -14,7 +14,7 @@ (***********************************************************************) (* - Time-stamp: + Time-stamp: *) open Xpath_internal_parser @@ -54,7 +54,7 @@ let return lexbuf tok = (tok, L.loc lexbuf) let return_loc i j tok = (tok, (i,j)) let regexp ncname_char = - xml_letter | xml_digit | [ '-' '_' ] | xml_combining_char | xml_extender | "\\." + xml_letter | xml_digit | [ '-' '_' '.'] | xml_combining_char | xml_extender let hexa_digit = function | '0'..'9' as c -> (Char.code c) - (Char.code '0') @@ -121,8 +121,17 @@ let rec token = lexer | ">=" -> GTE | "=" -> EQ | "!=" -> NEQ + | ".." -> DOTDOT + | "." -> DOT | "node()" -> NODE | "text()" -> TEXT + | "comment()" -> COMMENT + | '@' ncname -> ATTNAME (L.utf8_lexeme lexbuf) + | "processing-instruction()" -> PI "" + | "processing-instruction('"ncname"')" + | "processing-instruction(\""ncname"\")"-> + let s = L.utf8_lexeme lexbuf in + PI (String.sub s 24 (String.length s - 26)) | ncname -> keyword_or_tag (L.utf8_lexeme lexbuf) | float -> let s = L.utf8_lexeme lexbuf in @@ -165,5 +174,3 @@ and string start double = lexer | _ -> store_lexeme lexbuf; string start double lexbuf - -