Sha256: 8a57091ae791a6c73a384222a8ddef2fa258e41ce3f39904ebeb343ce497d2c7
Contents?: true
Size: 833 Bytes
Versions: 19
Compression:
Stored size: 833 Bytes
Contents
var TYPE = require('../../tokenizer').TYPE; var LEFTSQUAREBRACKET = TYPE.LeftSquareBracket; var RIGHTSQUAREBRACKET = TYPE.RightSquareBracket; module.exports = { name: 'Brackets', structure: { children: [[]] }, parse: function(readSequence, recognizer) { var start = this.scanner.tokenStart; var children = null; this.scanner.eat(LEFTSQUAREBRACKET); children = readSequence.call(this, recognizer); if (!this.scanner.eof) { this.scanner.eat(RIGHTSQUAREBRACKET); } return { type: 'Brackets', loc: this.getLocation(start, this.scanner.tokenStart), children: children }; }, generate: function(node) { this.chunk('['); this.children(node); this.chunk(']'); } };
Version data entries
19 entries across 18 versions & 4 rubygems