marko/compiler/ast/Declaration.js
2017-02-08 23:53:40 -08:00

28 lines
572 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(builder.text(this.declaration)),
builder.htmlLiteral('?>')
];
}
toJSON() {
return {
type: this.type,
value: this.value
};
}
}
module.exports = Declaration;