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