-
-
Save chrisdickinson/a05f3ce9ef8573094062 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var lang = require('cssauron')({ | |
tag: function(node) { return node.type } | |
, contents: function(node) { return node.data } | |
, id: function(node) { return 'line_'+node.token.line } | |
, attr: function(node) { return node[attr] } | |
, parent: function(node) { return node.parent } | |
, children: function(node) { return node.children } | |
, class: function(node) { throw new Error('classes not supported') } | |
}) | |
var selector = lang('stmtlist > stmt > decl') | |
selector(some_ast_node) // true or false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment