Allow the @id syntax in XPath expressions.
[tatoo.git] / src / xpath / ulexer.ml
index 2153e18..3e71c5a 100644 (file)
@@ -14,7 +14,7 @@
 (***********************************************************************)
 
 (*
-  Time-stamp: <Last modified on 2013-02-14 15:38:56 CET by Kim Nguyen>
+  Time-stamp: <Last modified on 2013-03-10 14:34:41 CET by Kim Nguyen>
 *)
 
 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')
@@ -123,6 +123,8 @@ let rec token = lexer
  | "!=" -> NEQ
  | "node()" -> NODE
  | "text()" -> TEXT
+ | '@' ncname -> ATTNAME (L.utf8_lexeme lexbuf)
+
  | ncname -> keyword_or_tag (L.utf8_lexeme lexbuf)
  | float ->
      let s = L.utf8_lexeme lexbuf in
@@ -165,5 +167,3 @@ and string start double = lexer
   | _ ->
       store_lexeme lexbuf;
       string start double lexbuf
-
-