MCPcopy Index your code
hub / github.com/jquery/esprima / parseJSXChildren

Method parseJSXChildren

src/jsx-parser.ts:529–549  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

527 }
528
529 parseJSXChildren(): JSXNode.JSXChild[] {
530 const children: JSXNode.JSXChild[] = [];
531
532 while (!this.scanner.eof()) {
533 const node = this.createJSXChildNode();
534 const token = this.nextJSXText();
535 if (token.start < token.end) {
536 const raw = this.getTokenRaw(token);
537 const child = this.finalize(node, new JSXNode.JSXText(token.value, raw));
538 children.push(child);
539 }
540 if (this.scanner.source[this.scanner.index] === '{') {
541 const container = this.parseJSXExpressionContainer();
542 children.push(container);
543 } else {
544 break;
545 }
546 }
547
548 return children;
549 }
550
551 parseComplexJSXElement(el: MetaJSXElement): MetaJSXElement {
552 const stack: MetaJSXElement[] = [];

Callers 1

Calls 7

createJSXChildNodeMethod · 0.95
nextJSXTextMethod · 0.95
eofMethod · 0.80
getTokenRawMethod · 0.80
finalizeMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected