aboutsummaryrefslogtreecommitdiffstats
path: root/vanilla/node_modules/css-tree/lib/syntax/node/Selector.js
diff options
context:
space:
mode:
Diffstat (limited to 'vanilla/node_modules/css-tree/lib/syntax/node/Selector.js')
-rw-r--r--vanilla/node_modules/css-tree/lib/syntax/node/Selector.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/vanilla/node_modules/css-tree/lib/syntax/node/Selector.js b/vanilla/node_modules/css-tree/lib/syntax/node/Selector.js
new file mode 100644
index 0000000..36028e0
--- /dev/null
+++ b/vanilla/node_modules/css-tree/lib/syntax/node/Selector.js
@@ -0,0 +1,31 @@
+export const name = 'Selector';
+export const structure = {
+ children: [[
+ 'TypeSelector',
+ 'IdSelector',
+ 'ClassSelector',
+ 'AttributeSelector',
+ 'PseudoClassSelector',
+ 'PseudoElementSelector',
+ 'Combinator'
+ ]]
+};
+
+export function parse() {
+ const children = this.readSequence(this.scope.Selector);
+
+ // nothing were consumed
+ if (this.getFirstListNode(children) === null) {
+ this.error('Selector is expected');
+ }
+
+ return {
+ type: 'Selector',
+ loc: this.getLocationFromList(children),
+ children
+ };
+}
+
+export function generate(node) {
+ this.children(node);
+}