once: boolean
reference(): number
- incraseId(): number
+ increaseId(): number
registerTemplate(): number
registerEffect(expr: string, operation: OperationNode): void
- registerOpration(...oprations: OperationNode[]): void
+ registerOperation(...operations: OperationNode[]): void
helper(name: string): string
}
dynamic: ir.dynamic,
once: false,
- incraseId: () => globalId++,
+ increaseId: () => globalId++,
reference() {
if (this.dynamic.id !== null) return this.dynamic.id
this.dynamic.referenced = true
- return (this.dynamic.id = this.incraseId())
+ return (this.dynamic.id = this.increaseId())
},
registerEffect(expr, operation) {
if (this.once) {
- return this.registerOpration(operation)
+ return this.registerOperation(operation)
}
if (!effect[expr]) effect[expr] = []
effect[expr].push(operation)
})
return ir.template.length - 1
},
- registerOpration(...node) {
+ registerOperation(...node) {
operation.push(...node)
},
// TODO not used yet
if (prevChildren.length)
if (hasStatic) {
childrenTemplate[index - prevChildren.length] = `<!>`
- const anchor = (prevChildren[0].placeholder = ctx.incraseId())
+ const anchor = (prevChildren[0].placeholder = ctx.increaseId())
- ctx.registerOpration({
+ ctx.registerOperation({
type: IRNodeTypes.INSERT_NODE,
loc: ctx.node.loc,
element: prevChildren.map((child) => child.id!),
anchor,
})
} else {
- ctx.registerOpration({
+ ctx.registerOperation({
type: IRNodeTypes.PREPEND_NODE,
loc: ctx.node.loc,
elements: prevChildren.map((child) => child.id!),
prevChildren.push(child)
if (index === children.length - 1) {
- ctx.registerOpration({
+ ctx.registerOperation({
type: IRNodeTypes.APPEND_NODE,
loc: ctx.node.loc,
elements: prevChildren.map((child) => child.id!),
} else {
const id = ctx.reference()
ctx.dynamic.ghost = true
- ctx.registerOpration({
+ ctx.registerOperation({
type: IRNodeTypes.CREATE_TEXT_NODE,
loc: node.loc,
id,