UNPKG

2.1 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.Heredoc = void 0;
4/**
5 * Heredoc represents a here-document that has been embedded in a
6 * Dockerfile.
7 *
8 * This API is experimental and subject to change.
9 */
10class Heredoc {
11 constructor(startRange, name, nameRange, contentRange, endRange) {
12 this.startRange = startRange;
13 this.name = name;
14 this.nameRange = nameRange;
15 this.contentRange = contentRange;
16 this.endRange = endRange;
17 }
18 /**
19 * Returns the name of the here-document.
20 *
21 * This API is experimental and subject to change.
22 */
23 getName() {
24 return this.name;
25 }
26 /**
27 * Returns the range of the start operator and the name. If the
28 * here-document is initialized with <<EOT then the start range would
29 * encompass all five characters.
30 *
31 * This API is experimental and subject to change.
32 */
33 getStartRange() {
34 return this.startRange;
35 }
36 /**
37 * Returns the range of this here-document's name that is declared at
38 * the beginning of the here-document with the operator. If the
39 * here-document is initialized with <<EOT then the name range would
40 * encompass the latter three "EOT" characters.
41 *
42 * This API is experimental and subject to change.
43 */
44 getNameRange() {
45 return this.nameRange;
46 }
47 /**
48 * Returns the range of the content of this here-document. This may
49 * be null if the here-document has no content because:
50 * - the start range is the only thing that was declared
51 * - the end range was declared immediately and there is no content
52 *
53 * This API is experimental and subject to change.
54 */
55 getContentRange() {
56 return this.contentRange;
57 }
58 /**
59 * Returns the range of the here-document's name on a line that
60 * represents the end of the here-document.
61 *
62 * This API is experimental and subject to change.
63 */
64 getDelimiterRange() {
65 return this.endRange;
66 }
67}
68exports.Heredoc = Heredoc;