1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const propertyInstruction_1 = require("../propertyInstruction");
|
4 | const util_1 = require("../util");
|
5 | class Label extends propertyInstruction_1.PropertyInstruction {
|
6 | constructor(document, range, dockerfile, escapeChar, instruction, instructionRange) {
|
7 | super(document, range, dockerfile, escapeChar, instruction, instructionRange);
|
8 | }
|
9 | getVariables() {
|
10 | const variables = super.getVariables();
|
11 | const properties = this.getProperties();
|
12 |
|
13 | for (const property of properties) {
|
14 | const value = property.getUnescapedValue();
|
15 |
|
16 |
|
17 | if (value !== null && value.length > 2 && value.charAt(0) === '\'' && value.charAt(value.length - 1) === '\'') {
|
18 | const range = property.getValueRange();
|
19 | for (let i = 0; i < variables.length; i++) {
|
20 |
|
21 | if (util_1.Util.isInsideRange(variables[i].getRange().start, range)) {
|
22 | variables.splice(i, 1);
|
23 | i--;
|
24 | }
|
25 | }
|
26 | }
|
27 | }
|
28 | return variables;
|
29 | }
|
30 | getProperties() {
|
31 | return super.getProperties();
|
32 | }
|
33 | }
|
34 | exports.Label = Label;
|