mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
27 lines
544 B
JavaScript
27 lines
544 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;
|
|
|
|
codegen.addWrite(builder.literal('<?'));
|
|
codegen.addWrite(this.declaration);
|
|
codegen.addWrite(builder.literal('?>'));
|
|
}
|
|
|
|
toJSON() {
|
|
return {
|
|
type: this.type,
|
|
value: this.value
|
|
};
|
|
}
|
|
}
|
|
|
|
module.exports = Declaration; |