.
[SXSI/xpathcomp.git] / ulexer.ml
index ab41b34..84ae969 100644 (file)
--- a/ulexer.ml
+++ b/ulexer.ml
@@ -188,15 +188,16 @@ let parse_char lexbuf base i =
 let rec token = lexer 
  | [' ' '\t'] -> token lexbuf
  | "text()" | "node()" | "and" | "not" | "or"
+ | "contains" |  "contains_full" | "endswith" | "startswith" | "equals" 
  | "self" | "descendant" | "child" | "descendant-or-self" 
- | "attribute" | "following-sibling"
- | "parent"
- | "(" |")" | "," | "::" | "/" | "//" | "[" | "]" | "*" | "." 
-     -> return lexbuf (KWD (L.utf8_lexeme lexbuf))
+ | "attribute" | "following-sibling" | "preceding-sibling"
+ | "parent" | "ancestor" | "ancestor-or-self" | "preceding" | "following"
+ | "(" |")" | "," | "::" | "/" | "//" | "[" | "]" | "*" | "."  | ".."
+     -> return lexbuf (KWD (L.utf8_lexeme lexbuf)) 
  | ncname -> return lexbuf (TAG(L.utf8_lexeme lexbuf))
  | '@' (ncname|'*') ->  
      let s = L.utf8_sub_lexeme lexbuf 1
-       (L.lexeme_length lexbuf - 2)
+       (L.lexeme_length lexbuf - 1)
      in return lexbuf (ATT(s))
  | '-'? ['0'-'9']+ -> let i =  INT (int_of_string(L.utf8_lexeme lexbuf)) in return lexbuf i
  | '"' | "'" ->