mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
28 lines
558 B
JavaScript
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; |