Failing XPath spec for double slashes.
The lexer doesn't lex things correctly due to "//" and "/" both being separate rules. As a result the lexer emits two T_SLASH tokens for queries such as ".//foo".
This commit is contained in:
1 parent
f4ae83498e
commit
f2fe2a4b47
1 file changed
+11
@@ -147,5 +147,16 @@ describe Oga::XPath::Lexer do
|
||||
[:T_RPAREN, nil],
|
||||
]
|
||||
end
|
||||
|
||||
example 'lex the . axis followed by a path' do
|
||||
lex_xpath('./foo').should == [
|
||||
[:T_AXIS, 'self'],
|
||||
[:T_IDENT, 'node'],
|
||||
[:T_LPAREN, nil],
|
||||
[:T_RPAREN, nil],
|
||||
[:T_SLASH, nil],
|
||||
[:T_IDENT, 'foo']
|
||||
]
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user