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

Method getParserUsage

external/.scrollLibs.js:18379–18392  ·  view source on GitHub ↗
(filepath = "")

Source from the content-addressed store, hash-verified

18377 return this
18378 }
18379 getParserUsage(filepath = "") {
18380 // returns a report on what parsers from its language the program uses
18381 const usage = new Particle()
18382 const handParsersProgram = this.handParsersProgram
18383 handParsersProgram.validConcreteAndAbstractParserDefinitions.forEach(def => {
18384 const requiredAtomTypeIds = def.atomParser.getRequiredAtomTypeIds()
18385 usage.appendLine([def.parserIdFromDefinition, "line-id", "parser", requiredAtomTypeIds.join(" ")].join(" "))
18386 })
18387 this.topDownArray.forEach((particle, lineNumber) => {
18388 const stats = usage.getParticle(particle.parserId)
18389 stats.appendLine([filepath + "-" + lineNumber, particle.atoms.join(" ")].join(" "))
18390 })
18391 return usage
18392 }
18393 toPaintParticles() {
18394 return this.topDownArray.map(subparticle => subparticle.indentation + subparticle.getLinePaints()).join("\n")
18395 }

Callers

nothing calls this directly

Calls 5

appendLineMethod · 0.95
getParticleMethod · 0.95
forEachMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected