mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
27 lines
549 B
JavaScript
27 lines
549 B
JavaScript
'use strict';
|
|
var Node = require('./Node');
|
|
|
|
class DocumentType extends Node {
|
|
constructor(def) {
|
|
super('DocumentType');
|
|
this.documentType = def.documentType;
|
|
}
|
|
|
|
generateHtmlCode(codegen) {
|
|
|
|
var builder = codegen.builder;
|
|
|
|
codegen.addWrite(builder.literal('<!'));
|
|
codegen.addWrite(this.documentType);
|
|
codegen.addWrite(builder.literal('>'));
|
|
}
|
|
|
|
toJSON() {
|
|
return {
|
|
type: this.type,
|
|
value: this.value
|
|
};
|
|
}
|
|
}
|
|
|
|
module.exports = DocumentType; |