Preparing for postprocessor-based macros.
This commit is contained in:
parent
5dcf6598ba
commit
c869c9c5d5
@ -93,14 +93,9 @@ export async function parse(lines, schema) {
|
|||||||
ended = await doc.next()
|
ended = await doc.next()
|
||||||
if (ended) break;
|
if (ended) break;
|
||||||
const level = doc.level()
|
const level = doc.level()
|
||||||
|
const scope = scopes[level] || []
|
||||||
scopes.length = level + 1
|
scopes.length = level + 1
|
||||||
|
|
||||||
if (lastLevel == level) {
|
|
||||||
console.log('||DECREASE: ', doc.line())
|
|
||||||
}
|
|
||||||
|
|
||||||
lastLevel = level
|
|
||||||
|
|
||||||
let entry = [doc.line()]
|
let entry = [doc.line()]
|
||||||
|
|
||||||
Object.keys(schema.root).forEach(key => {
|
Object.keys(schema.root).forEach(key => {
|
||||||
@ -109,12 +104,17 @@ export async function parse(lines, schema) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const scope = scopes[level] || []
|
|
||||||
if (!scopes[level]) {
|
if (!scopes[level]) {
|
||||||
scopes[level] = scope
|
scopes[level] = scope
|
||||||
scopes[level - 1].at(-1)[1] = scopes[level]
|
scopes[level - 1].at(-1)[1] = scopes[level]
|
||||||
}
|
}
|
||||||
scope.push(entry)
|
scope.push(entry)
|
||||||
|
|
||||||
|
if (lastLevel == level) {
|
||||||
|
console.log('DECREASE: ', doc.line(), scope)
|
||||||
|
}
|
||||||
|
|
||||||
|
lastLevel = level
|
||||||
}
|
}
|
||||||
|
|
||||||
return scopes[0]
|
return scopes[0]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user