source: trip-planner-front/node_modules/css-tree/lib/syntax/node/Parentheses.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 812 bytes
Line 
1var TYPE = require('../../tokenizer').TYPE;
2
3var LEFTPARENTHESIS = TYPE.LeftParenthesis;
4var RIGHTPARENTHESIS = TYPE.RightParenthesis;
5
6module.exports = {
7 name: 'Parentheses',
8 structure: {
9 children: [[]]
10 },
11 parse: function(readSequence, recognizer) {
12 var start = this.scanner.tokenStart;
13 var children = null;
14
15 this.eat(LEFTPARENTHESIS);
16
17 children = readSequence.call(this, recognizer);
18
19 if (!this.scanner.eof) {
20 this.eat(RIGHTPARENTHESIS);
21 }
22
23 return {
24 type: 'Parentheses',
25 loc: this.getLocation(start, this.scanner.tokenStart),
26 children: children
27 };
28 },
29 generate: function(node) {
30 this.chunk('(');
31 this.children(node);
32 this.chunk(')');
33 }
34};
Note: See TracBrowser for help on using the repository browser.