X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=src%2Fxpath%2Fulexer.ml;h=02b6e02055cc5a9aa620dc56c1dff520895bb564;hp=3e71c5a7b6b8cd4e38b2c5d17409723967f99c6a;hb=fe2ba1820282783ae8c10fbbbd2b65d3dc4c67f2;hpb=238dc42c2cb6324b103585556c3f5f9150ee221e diff --git a/src/xpath/ulexer.ml b/src/xpath/ulexer.ml index 3e71c5a..02b6e02 100644 --- a/src/xpath/ulexer.ml +++ b/src/xpath/ulexer.ml @@ -13,10 +13,6 @@ (* *) (***********************************************************************) -(* - Time-stamp: -*) - open Xpath_internal_parser module L = Ulexing @@ -121,10 +117,18 @@ let rec token = lexer | ">=" -> GTE | "=" -> EQ | "!=" -> NEQ + | ".." -> DOTDOT + | "." -> DOT | "node()" -> NODE | "text()" -> TEXT - | '@' ncname -> ATTNAME (L.utf8_lexeme lexbuf) - + | "comment()" -> COMMENT + | '@' ncname -> let l = L.utf8_lexeme lexbuf in + ATTNAME (String.sub l 1 (String.length l - 1)) + | "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