Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/flo-bit/shapecraft. flo-bit.dev/shapecraft
Something went wrong. Try again.
693 B · 34 lines
JavaScript
at commit da69385e
1234567891011121314151617181920212223242526272829303132333435import { LeftParenthesis, RightParenthesis} from '../../tokenizer/index.js';
export const name = 'Parentheses';export const structure = { children: [[]]};
export function parse(readSequence, recognizer) { const start = this.tokenStart; let children = null;
this.eat(LeftParenthesis);
children = readSequence.call(this, recognizer);
if (!this.eof) { this.eat(RightParenthesis); }
return { type: 'Parentheses', loc: this.getLocation(start, this.tokenStart), children };}
export function generate(node) { this.token(LeftParenthesis, '('); this.children(node); this.token(RightParenthesis, ')');}