1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const Builder_1 = require("./Builder");
|
4 |
|
5 | class Terminal extends Builder_1.default {
|
6 | constructor(spec, prod, node) {
|
7 | super(spec, node);
|
8 | this.production = prod;
|
9 | this.optional = node.hasAttribute('optional');
|
10 | }
|
11 | build() {
|
12 | let modifiers = '';
|
13 | if (this.optional) {
|
14 | modifiers += '<emu-opt>opt</emu-opt>';
|
15 | }
|
16 | if (modifiers === '')
|
17 | return;
|
18 | const el = this.spec.doc.createElement('emu-mods');
|
19 | el.innerHTML = modifiers;
|
20 | this.node.appendChild(el);
|
21 | }
|
22 | }
|
23 | exports.default = Terminal;
|