MCPcopy Create free account
hub / github.com/breck7/scroll / compile

Method compile

external/.scrollLibs.js:18580–18594  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18578 }
18579 fromTypedMap() {}
18580 compile() {
18581 if (this.isRoot()) return super.compile()
18582 const def = this.definition
18583 const indent = this._getCompiledIndentation()
18584 const compiledLine = this._getCompiledLine()
18585 if (def.isTerminalParser()) return indent + compiledLine
18586 const compiler = def._getCompilerObject()
18587 const openSubparticlesString = compiler[ParsersConstantsCompiler.openSubparticles] || ""
18588 const closeSubparticlesString = compiler[ParsersConstantsCompiler.closeSubparticles] || ""
18589 const subparticleJoinCharacter = compiler[ParsersConstantsCompiler.joinSubparticlesWith] || "\n"
18590 const compiledSubparticles = this.map(subparticle => subparticle.compile()).join(subparticleJoinCharacter)
18591 return `${indent + compiledLine}${openSubparticlesString}
18592${compiledSubparticles}
18593${indent}${closeSubparticlesString}`
18594 }
18595 // todo: remove
18596 get atomsMap() {
18597 const atomsMap = {}

Callers

nothing calls this directly

Calls 8

_getCompiledLineMethod · 0.95
isRootMethod · 0.80
isTerminalParserMethod · 0.80
_getCompilerObjectMethod · 0.80
mapMethod · 0.80
compileMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected