MCPcopy Create free account
hub / github.com/MirrowApp/mirrow / parseElement

Method parseElement

packages/core/src/compiler/parser.ts:414–439  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

412 }
413
414 private parseElement(): ElementNode {
415 const nameToken = this.consume(
416 TokenType.IDENTIFIER,
417 "Expected element name"
418 );
419 const keyword = this.lookupKeyword(nameToken.value, nameToken.position);
420
421 const blockToken = this.consume(
422 TokenType.BLOCK,
423 `Expected block to describe <${keyword!.name}>`
424 );
425 const { attributes, children, cssStates, jsEvents, dataId } =
426 this.parseElementBlock(keyword, blockToken);
427 this.verifyAttributes(keyword, attributes, nameToken.position);
428
429 return {
430 type: "Element",
431 name: keyword.name,
432 attributes,
433 children,
434 cssStates,
435 jsEvents,
436 dataId,
437 position: nameToken.position,
438 };
439 }
440
441 private parseElementBlock(
442 keyword: Keyword,

Callers 2

parseMethod · 0.95
collectBlockEntriesMethod · 0.95

Calls 4

consumeMethod · 0.95
lookupKeywordMethod · 0.95
parseElementBlockMethod · 0.95
verifyAttributesMethod · 0.95

Tested by

no test coverage detected