|
|
|
@ -2,23 +2,20 @@ import CodeBuilder from '../../../utils/CodeBuilder.js';
|
|
|
|
|
import deindent from '../../../utils/deindent.js';
|
|
|
|
|
import visit from '../visit.js';
|
|
|
|
|
import addElementAttributes from './attributes/addElementAttributes.js';
|
|
|
|
|
import Component from './Component.js';
|
|
|
|
|
import Window from './meta/Window.js';
|
|
|
|
|
import visitComponent from './Component.js';
|
|
|
|
|
import visitWindow from './meta/Window.js';
|
|
|
|
|
|
|
|
|
|
const meta = {
|
|
|
|
|
':Window': Window
|
|
|
|
|
':Window': visitWindow
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
enter ( generator, node ) {
|
|
|
|
|
export default function visitElement ( generator, node ) {
|
|
|
|
|
if ( node.name in meta ) {
|
|
|
|
|
return meta[ node.name ].enter( generator, node );
|
|
|
|
|
return meta[ node.name ]( generator, node );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const isComponent = generator.components.has( node.name ) || node.name === ':Self';
|
|
|
|
|
|
|
|
|
|
if ( isComponent ) {
|
|
|
|
|
return Component.enter( generator, node );
|
|
|
|
|
if ( generator.components.has( node.name ) || node.name === ':Self' ) {
|
|
|
|
|
return visitComponent( generator, node );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const name = generator.current.getUniqueName( node.name );
|
|
|
|
@ -118,15 +115,9 @@ export default {
|
|
|
|
|
|
|
|
|
|
generator.elementDepth -= 1;
|
|
|
|
|
|
|
|
|
|
if ( node.name in meta ) {
|
|
|
|
|
if ( meta[ node.name ].leave ) meta[ node.name ].leave( generator, node );
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( node.initialUpdate ) {
|
|
|
|
|
generator.current.builders.init.addBlock( node.initialUpdate );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
generator.pop();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|