Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/flo-bit/shapecraft. flo-bit.dev/shapecraft
Something went wrong. Try again.
1.0 kB · 47 lines
at commit da69385e
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748'use strict';
const types = require('../tokenizer/types.cjs');
function readSequence(recognizer) { const children = this.createList(); let space = false; const context = { recognizer };
while (!this.eof) { switch (this.tokenType) { case types.Comment: this.next(); continue;
case types.WhiteSpace: space = true; this.next(); continue; }
let child = recognizer.getNode.call(this, context);
if (child === undefined) { break; }
if (space) { if (recognizer.onWhiteSpace) { recognizer.onWhiteSpace.call(this, child, children, context); } space = false; }
children.push(child); }
if (space && recognizer.onWhiteSpace) { recognizer.onWhiteSpace.call(this, null, children, context); }
return children;}
exports.readSequence = readSequence;