marko/compiler/ast/Declaration.js
2016-08-19 15:27:05 -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;