Lexing/parsing of CSS pseudos with ident arguments
This allows the lexing/parsing of expressions such as "html:lang(en)".
This commit is contained in:
1 parent
d9a4221a0a
commit
48eb4f83df
4 files changed
+30
-6
No files matched your search
@@ -116,5 +116,15 @@ describe Oga::CSS::Lexer do
|
||||
[:T_RPAREN, nil]
|
||||
]
|
||||
end
|
||||
|
||||
example 'lex the :lang(fr) pseudo class' do
|
||||
lex_css(':lang(fr)').should == [
|
||||
[:T_COLON, nil],
|
||||
[:T_IDENT, 'lang'],
|
||||
[:T_LPAREN, nil],
|
||||
[:T_IDENT, 'fr'],
|
||||
[:T_RPAREN, nil]
|
||||
]
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -107,5 +107,14 @@ describe Oga::CSS::Parser do
|
||||
s(:pseudo, 'focus', s(:test, nil, 'x'))
|
||||
)
|
||||
end
|
||||
|
||||
example 'parse a pseudo class with an identifier as the argument' do
|
||||
parse_css('x:lang(fr)').should == s(
|
||||
:pseudo,
|
||||
'lang',
|
||||
s(:test, nil, 'x'),
|
||||
s(:test, nil, 'fr')
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user