let rec token = lexer
| [' ' '\t'] -> token lexbuf
| "text()" | "node()" | "and" | "not" | "or"
+ | "contains" | "contains_full"
| "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
| '"' | "'" ->