marko/compiler/ast/Declaration.js
Patrick Steele-Idem c386da875e Fixes #349 - Inline Marko template compilation support
Also changed how JavaScript code is generated
2016-08-19 10:50:28 -06:00

28 lines
558 B
JavaScript

'use strict';
var Node = require('./Node');
class Declaration extends Node {
constructor(def) {
super('Declaration');
this.declaration = def.declaration;
}
generateHtmlCode(codegen) {
var builder = codegen.builder;
return [
builder.htmlLiteral('<?'),
codegen.generateCode(this.declaration),
builder.htmlLiteral('?>')
];
}
toJSON() {
return {
type: this.type,
value: this.value
};
}
}
module.exports = Declaration;