Parsing support for the :first-child pseudo class.
This commit is contained in:
1 parent
020d979fba
commit
b4fec3cc8c
2 files changed
+24
No files matched your search
@@ -488,6 +488,19 @@ end
|
||||
return node
|
||||
end
|
||||
|
||||
##
|
||||
# Generates the AST for the `:first-child` selector.
|
||||
#
|
||||
# @return [AST::Node]
|
||||
#
|
||||
def on_pseudo_class_first_child
|
||||
return s(
|
||||
:eq,
|
||||
s(:call, 'count', s(:axis, 'preceding-sibling', s(:test, nil, '*'))),
|
||||
s(:int, 0)
|
||||
)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
##
|
||||
|
||||
Reference in new issue
Block a user