windmill-cli 1.638.4 → 1.640.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.js +1 -1
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_loader_state.js +216 -175
- package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/parse.js +0 -2
- package/esm/deps.js +3 -3
- package/esm/gen/core/OpenAPI.js +1 -1
- package/esm/src/commands/app/app_metadata.js +36 -12
- package/esm/src/commands/flow/flow_metadata.js +21 -9
- package/esm/src/commands/lint/lint.js +417 -1
- package/esm/src/commands/sync/sync.js +46 -7
- package/esm/src/commands/workspace/workspace.js +6 -2
- package/esm/src/main.js +1 -1
- package/esm/src/utils/metadata.js +45 -8
- package/esm/src/utils/script_common.js +10 -0
- package/esm/windmill-utils-internal/src/inline-scripts/extractor.js +3 -2
- package/package.json +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/_create_walk_entry.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/_get_file_info_type.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/_is_same_path.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/_is_subdir.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/_to_path_string.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/copy.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/empty_dir.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/ensure_dir.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/ensure_file.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/ensure_link.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/ensure_symlink.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/eol.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/exists.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/expand_glob.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/mod.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/move.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/walk.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_chars.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_dumper_state.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_loader_state.d.ts +0 -5
- package/types/deps/jsr.io/@std/yaml/1.0.12/_loader_state.d.ts.map +1 -0
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_schema.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/binary.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/bool.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/float.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/int.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/map.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/merge.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/nil.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/omap.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/pairs.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/regexp.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/seq.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/set.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/str.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/timestamp.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/undefined.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_utils.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/mod.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/parse.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/stringify.d.ts.map +1 -1
- package/types/deps.d.ts +3 -3
- package/types/src/commands/app/app_metadata.d.ts +5 -0
- package/types/src/commands/app/app_metadata.d.ts.map +1 -1
- package/types/src/commands/flow/flow_metadata.d.ts.map +1 -1
- package/types/src/commands/lint/lint.d.ts +11 -0
- package/types/src/commands/lint/lint.d.ts.map +1 -1
- package/types/src/commands/sync/sync.d.ts +2 -0
- package/types/src/commands/sync/sync.d.ts.map +1 -1
- package/types/src/commands/workspace/workspace.d.ts +1 -1
- package/types/src/commands/workspace/workspace.d.ts.map +1 -1
- package/types/src/core/conf.d.ts +1 -0
- package/types/src/core/conf.d.ts.map +1 -1
- package/types/src/main.d.ts +1 -1
- package/types/src/utils/metadata.d.ts +16 -0
- package/types/src/utils/metadata.d.ts.map +1 -1
- package/types/src/utils/script_common.d.ts +5 -0
- package/types/src/utils/script_common.d.ts.map +1 -1
- package/types/windmill-utils-internal/src/inline-scripts/extractor.d.ts +5 -3
- package/types/windmill-utils-internal/src/inline-scripts/extractor.d.ts.map +1 -1
- package/types/deps/jsr.io/@std/yaml/1.0.11/_loader_state.d.ts.map +0 -1
- /package/esm/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/_create_walk_entry.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/_get_file_info_type.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/_is_same_path.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/_is_subdir.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/_to_path_string.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/copy.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/empty_dir.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/ensure_dir.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/ensure_file.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/ensure_link.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/ensure_symlink.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/eol.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/exists.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/expand_glob.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/mod.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/move.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/walk.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_chars.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_dumper_state.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_schema.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/binary.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/bool.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/float.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/int.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/map.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/merge.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/nil.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/omap.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/pairs.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/regexp.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/seq.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/set.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/str.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/timestamp.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/undefined.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_utils.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/mod.js +0 -0
- /package/esm/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/stringify.js +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/_create_walk_entry.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/_get_file_info_type.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/_is_same_path.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/_is_subdir.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/_to_path_string.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/copy.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/empty_dir.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/ensure_dir.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/ensure_file.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/ensure_link.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/ensure_symlink.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/eol.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/exists.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/expand_glob.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/mod.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/move.d.ts +0 -0
- /package/types/deps/jsr.io/@std/fs/{1.0.22 → 1.0.23}/walk.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_chars.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_dumper_state.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_schema.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/binary.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/bool.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/float.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/int.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/map.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/merge.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/nil.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/omap.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/pairs.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/regexp.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/seq.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/set.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/str.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/timestamp.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type/undefined.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_type.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/_utils.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/mod.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/parse.d.ts +0 -0
- /package/types/deps/jsr.io/@std/yaml/{1.0.11 → 1.0.12}/stringify.d.ts +0 -0
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
// https://github.com/nodeca/js-yaml/commit/665aadda42349dcae869f12040d9b10ef18d12da
|
|
3
3
|
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
|
4
4
|
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
5
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
6
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
7
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
8
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
9
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
10
|
+
};
|
|
5
11
|
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
6
12
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
7
13
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
8
14
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
9
15
|
};
|
|
10
|
-
var _LoaderState_instances, _LoaderState_createError;
|
|
16
|
+
var _Scanner_length, _LoaderState_instances, _LoaderState_scanner, _LoaderState_createError;
|
|
11
17
|
import { AMPERSAND, ASTERISK, BACKSLASH, CARRIAGE_RETURN, COLON, COMMA, COMMERCIAL_AT, DOT, DOUBLE_QUOTE, EXCLAMATION, GRAVE_ACCENT, GREATER_THAN, isEOL, isFlowIndicator, isWhiteSpace, isWhiteSpaceOrEOL, LEFT_CURLY_BRACKET, LEFT_SQUARE_BRACKET, LINE_FEED, MINUS, PERCENT, PLUS, QUESTION, RIGHT_CURLY_BRACKET, RIGHT_SQUARE_BRACKET, SHARP, SINGLE_QUOTE, SMALLER_THAN, SPACE, VERTICAL_LINE, } from "./_chars.js";
|
|
12
18
|
import { DEFAULT_SCHEMA } from "./_schema.js";
|
|
13
19
|
import { isObject, isPlainObject } from "./_utils.js";
|
|
@@ -137,21 +143,41 @@ function writeFoldedLines(count) {
|
|
|
137
143
|
return "\n".repeat(count - 1);
|
|
138
144
|
return "";
|
|
139
145
|
}
|
|
140
|
-
|
|
141
|
-
constructor(
|
|
142
|
-
|
|
143
|
-
Object.defineProperty(this, "input", {
|
|
146
|
+
class Scanner {
|
|
147
|
+
constructor(source) {
|
|
148
|
+
Object.defineProperty(this, "source", {
|
|
144
149
|
enumerable: true,
|
|
145
150
|
configurable: true,
|
|
146
151
|
writable: true,
|
|
147
152
|
value: void 0
|
|
148
153
|
});
|
|
149
|
-
|
|
154
|
+
_Scanner_length.set(this, void 0);
|
|
155
|
+
Object.defineProperty(this, "position", {
|
|
150
156
|
enumerable: true,
|
|
151
157
|
configurable: true,
|
|
152
158
|
writable: true,
|
|
153
|
-
value:
|
|
159
|
+
value: 0
|
|
154
160
|
});
|
|
161
|
+
// Use 0 as string terminator. That significantly simplifies bounds check.
|
|
162
|
+
source += "\0";
|
|
163
|
+
this.source = source;
|
|
164
|
+
__classPrivateFieldSet(this, _Scanner_length, source.length, "f");
|
|
165
|
+
}
|
|
166
|
+
peek(offset = 0) {
|
|
167
|
+
return this.source.charCodeAt(this.position + offset);
|
|
168
|
+
}
|
|
169
|
+
next() {
|
|
170
|
+
this.position += 1;
|
|
171
|
+
}
|
|
172
|
+
eof() {
|
|
173
|
+
return this.position >= __classPrivateFieldGet(this, _Scanner_length, "f") - 1;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
_Scanner_length = new WeakMap();
|
|
177
|
+
export class LoaderState {
|
|
178
|
+
constructor(input, { schema = DEFAULT_SCHEMA, onWarning, allowDuplicateKeys = false, }) {
|
|
179
|
+
_LoaderState_instances.add(this);
|
|
180
|
+
_LoaderState_scanner.set(this, void 0);
|
|
155
181
|
Object.defineProperty(this, "lineIndent", {
|
|
156
182
|
enumerable: true,
|
|
157
183
|
configurable: true,
|
|
@@ -164,12 +190,6 @@ export class LoaderState {
|
|
|
164
190
|
writable: true,
|
|
165
191
|
value: 0
|
|
166
192
|
});
|
|
167
|
-
Object.defineProperty(this, "position", {
|
|
168
|
-
enumerable: true,
|
|
169
|
-
configurable: true,
|
|
170
|
-
writable: true,
|
|
171
|
-
value: 0
|
|
172
|
-
});
|
|
173
193
|
Object.defineProperty(this, "line", {
|
|
174
194
|
enumerable: true,
|
|
175
195
|
configurable: true,
|
|
@@ -218,43 +238,39 @@ export class LoaderState {
|
|
|
218
238
|
writable: true,
|
|
219
239
|
value: new Map()
|
|
220
240
|
});
|
|
221
|
-
this
|
|
241
|
+
__classPrivateFieldSet(this, _LoaderState_scanner, new Scanner(input), "f");
|
|
222
242
|
this.onWarning = onWarning;
|
|
223
243
|
this.allowDuplicateKeys = allowDuplicateKeys;
|
|
224
244
|
this.implicitTypes = schema.implicitTypes;
|
|
225
245
|
this.typeMap = schema.typeMap;
|
|
226
|
-
this.length = input.length;
|
|
227
246
|
this.readIndent();
|
|
228
247
|
}
|
|
229
248
|
skipWhitespaces() {
|
|
230
|
-
let ch = this.peek();
|
|
249
|
+
let ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
231
250
|
while (isWhiteSpace(ch)) {
|
|
232
|
-
|
|
251
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
252
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
233
253
|
}
|
|
234
254
|
}
|
|
235
255
|
skipComment() {
|
|
236
|
-
let ch = this.peek();
|
|
256
|
+
let ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
237
257
|
if (ch !== SHARP)
|
|
238
258
|
return;
|
|
239
|
-
|
|
259
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
260
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
240
261
|
while (ch !== 0 && !isEOL(ch)) {
|
|
241
|
-
|
|
262
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
263
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
242
264
|
}
|
|
243
265
|
}
|
|
244
266
|
readIndent() {
|
|
245
|
-
let
|
|
246
|
-
while (
|
|
267
|
+
let ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
268
|
+
while (ch === SPACE) {
|
|
247
269
|
this.lineIndent += 1;
|
|
248
|
-
|
|
270
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
271
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
249
272
|
}
|
|
250
273
|
}
|
|
251
|
-
peek(offset = 0) {
|
|
252
|
-
return this.input.charCodeAt(this.position + offset);
|
|
253
|
-
}
|
|
254
|
-
next() {
|
|
255
|
-
this.position += 1;
|
|
256
|
-
return this.peek();
|
|
257
|
-
}
|
|
258
274
|
dispatchWarning(message) {
|
|
259
275
|
const error = __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, message);
|
|
260
276
|
this.onWarning?.(error);
|
|
@@ -297,7 +313,7 @@ export class LoaderState {
|
|
|
297
313
|
}
|
|
298
314
|
captureSegment(start, end, checkJson) {
|
|
299
315
|
if (start < end) {
|
|
300
|
-
const result = this.
|
|
316
|
+
const result = __classPrivateFieldGet(this, _LoaderState_scanner, "f").source.slice(start, end);
|
|
301
317
|
if (checkJson) {
|
|
302
318
|
for (let position = 0; position < result.length; position++) {
|
|
303
319
|
const character = result.charCodeAt(position);
|
|
@@ -318,21 +334,21 @@ export class LoaderState {
|
|
|
318
334
|
const result = [];
|
|
319
335
|
if (anchor !== null)
|
|
320
336
|
this.anchorMap.set(anchor, result);
|
|
321
|
-
let ch = this.peek();
|
|
337
|
+
let ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
322
338
|
while (ch !== 0) {
|
|
323
339
|
if (ch !== MINUS) {
|
|
324
340
|
break;
|
|
325
341
|
}
|
|
326
|
-
const following = this.peek(1);
|
|
342
|
+
const following = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek(1);
|
|
327
343
|
if (!isWhiteSpaceOrEOL(following)) {
|
|
328
344
|
break;
|
|
329
345
|
}
|
|
330
346
|
detected = true;
|
|
331
|
-
this.
|
|
347
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
332
348
|
if (this.skipSeparationSpace(true, -1)) {
|
|
333
349
|
if (this.lineIndent <= nodeIndent) {
|
|
334
350
|
result.push(null);
|
|
335
|
-
ch = this.peek();
|
|
351
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
336
352
|
continue;
|
|
337
353
|
}
|
|
338
354
|
}
|
|
@@ -346,7 +362,7 @@ export class LoaderState {
|
|
|
346
362
|
if (newState)
|
|
347
363
|
result.push(newState.result);
|
|
348
364
|
this.skipSeparationSpace(true, -1);
|
|
349
|
-
ch = this.peek();
|
|
365
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
350
366
|
if ((this.line === line || this.lineIndent > nodeIndent) && ch !== 0) {
|
|
351
367
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Cannot read block sequence: bad indentation of a sequence entry");
|
|
352
368
|
}
|
|
@@ -410,7 +426,7 @@ export class LoaderState {
|
|
|
410
426
|
!overridableKeys.has(keyNode) &&
|
|
411
427
|
Object.hasOwn(result, keyNode)) {
|
|
412
428
|
this.line = startLine || this.line;
|
|
413
|
-
this.position = startPos || this.position;
|
|
429
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").position = startPos || __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
414
430
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Cannot store mapping pair: duplicated key");
|
|
415
431
|
}
|
|
416
432
|
Object.defineProperty(result, keyNode, {
|
|
@@ -424,39 +440,39 @@ export class LoaderState {
|
|
|
424
440
|
return result;
|
|
425
441
|
}
|
|
426
442
|
readLineBreak() {
|
|
427
|
-
const ch = this.peek();
|
|
443
|
+
const ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
428
444
|
if (ch === LINE_FEED) {
|
|
429
|
-
this.
|
|
445
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
430
446
|
}
|
|
431
447
|
else if (ch === CARRIAGE_RETURN) {
|
|
432
|
-
this.
|
|
433
|
-
if (this.peek() === LINE_FEED) {
|
|
434
|
-
this.
|
|
448
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
449
|
+
if (__classPrivateFieldGet(this, _LoaderState_scanner, "f").peek() === LINE_FEED) {
|
|
450
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
435
451
|
}
|
|
436
452
|
}
|
|
437
453
|
else {
|
|
438
454
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Cannot read line: line break not found");
|
|
439
455
|
}
|
|
440
456
|
this.line += 1;
|
|
441
|
-
this.lineStart = this.position;
|
|
457
|
+
this.lineStart = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
442
458
|
}
|
|
443
459
|
skipSeparationSpace(allowComments, checkIndent) {
|
|
444
460
|
let lineBreaks = 0;
|
|
445
|
-
let ch = this.peek();
|
|
461
|
+
let ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
446
462
|
while (ch !== 0) {
|
|
447
463
|
this.skipWhitespaces();
|
|
448
|
-
ch = this.peek();
|
|
464
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
449
465
|
if (allowComments) {
|
|
450
466
|
this.skipComment();
|
|
451
|
-
ch = this.peek();
|
|
467
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
452
468
|
}
|
|
453
469
|
if (isEOL(ch)) {
|
|
454
470
|
this.readLineBreak();
|
|
455
|
-
ch = this.peek();
|
|
471
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
456
472
|
lineBreaks++;
|
|
457
473
|
this.lineIndent = 0;
|
|
458
474
|
this.readIndent();
|
|
459
|
-
ch = this.peek();
|
|
475
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
460
476
|
}
|
|
461
477
|
else {
|
|
462
478
|
break;
|
|
@@ -470,13 +486,13 @@ export class LoaderState {
|
|
|
470
486
|
return lineBreaks;
|
|
471
487
|
}
|
|
472
488
|
testDocumentSeparator() {
|
|
473
|
-
let ch = this.peek();
|
|
474
|
-
// Condition this.position === this.lineStart is tested
|
|
489
|
+
let ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
490
|
+
// Condition this.#scanner.position === this.lineStart is tested
|
|
475
491
|
// in parent on each call, for efficiency. No needs to test here again.
|
|
476
492
|
if ((ch === MINUS || ch === DOT) &&
|
|
477
|
-
ch === this.peek(1) &&
|
|
478
|
-
ch === this.peek(2)) {
|
|
479
|
-
ch = this.peek(3);
|
|
493
|
+
ch === __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek(1) &&
|
|
494
|
+
ch === __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek(2)) {
|
|
495
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek(3);
|
|
480
496
|
if (ch === 0 || isWhiteSpaceOrEOL(ch)) {
|
|
481
497
|
return true;
|
|
482
498
|
}
|
|
@@ -484,7 +500,7 @@ export class LoaderState {
|
|
|
484
500
|
return false;
|
|
485
501
|
}
|
|
486
502
|
readPlainScalar(tag, anchor, nodeIndent, withinFlowCollection) {
|
|
487
|
-
let ch = this.peek();
|
|
503
|
+
let ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
488
504
|
if (isWhiteSpaceOrEOL(ch) ||
|
|
489
505
|
isFlowIndicator(ch) ||
|
|
490
506
|
ch === SHARP ||
|
|
@@ -502,32 +518,33 @@ export class LoaderState {
|
|
|
502
518
|
}
|
|
503
519
|
let following;
|
|
504
520
|
if (ch === QUESTION || ch === MINUS) {
|
|
505
|
-
following = this.peek(1);
|
|
521
|
+
following = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek(1);
|
|
506
522
|
if (isWhiteSpaceOrEOL(following) ||
|
|
507
523
|
(withinFlowCollection && isFlowIndicator(following))) {
|
|
508
524
|
return;
|
|
509
525
|
}
|
|
510
526
|
}
|
|
511
527
|
let result = "";
|
|
512
|
-
let captureEnd = this.position;
|
|
513
|
-
let captureStart = this.position;
|
|
528
|
+
let captureEnd = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
529
|
+
let captureStart = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
514
530
|
let hasPendingContent = false;
|
|
515
531
|
let line = 0;
|
|
516
532
|
while (ch !== 0) {
|
|
517
533
|
if (ch === COLON) {
|
|
518
|
-
following = this.peek(1);
|
|
534
|
+
following = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek(1);
|
|
519
535
|
if (isWhiteSpaceOrEOL(following) ||
|
|
520
536
|
(withinFlowCollection && isFlowIndicator(following))) {
|
|
521
537
|
break;
|
|
522
538
|
}
|
|
523
539
|
}
|
|
524
540
|
else if (ch === SHARP) {
|
|
525
|
-
const preceding = this.peek(-1);
|
|
541
|
+
const preceding = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek(-1);
|
|
526
542
|
if (isWhiteSpaceOrEOL(preceding)) {
|
|
527
543
|
break;
|
|
528
544
|
}
|
|
529
545
|
}
|
|
530
|
-
else if ((this.position === this.lineStart &&
|
|
546
|
+
else if ((__classPrivateFieldGet(this, _LoaderState_scanner, "f").position === this.lineStart &&
|
|
547
|
+
this.testDocumentSeparator()) ||
|
|
531
548
|
(withinFlowCollection && isFlowIndicator(ch))) {
|
|
532
549
|
break;
|
|
533
550
|
}
|
|
@@ -538,11 +555,11 @@ export class LoaderState {
|
|
|
538
555
|
this.skipSeparationSpace(false, -1);
|
|
539
556
|
if (this.lineIndent >= nodeIndent) {
|
|
540
557
|
hasPendingContent = true;
|
|
541
|
-
ch = this.peek();
|
|
558
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
542
559
|
continue;
|
|
543
560
|
}
|
|
544
561
|
else {
|
|
545
|
-
this.position = captureEnd;
|
|
562
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").position = captureEnd;
|
|
546
563
|
this.line = line;
|
|
547
564
|
this.lineStart = lineStart;
|
|
548
565
|
this.lineIndent = lineIndent;
|
|
@@ -554,13 +571,14 @@ export class LoaderState {
|
|
|
554
571
|
if (segment)
|
|
555
572
|
result += segment;
|
|
556
573
|
result += writeFoldedLines(this.line - line);
|
|
557
|
-
captureStart = captureEnd = this.position;
|
|
574
|
+
captureStart = captureEnd = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
558
575
|
hasPendingContent = false;
|
|
559
576
|
}
|
|
560
577
|
if (!isWhiteSpace(ch)) {
|
|
561
|
-
captureEnd = this.position + 1;
|
|
578
|
+
captureEnd = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position + 1;
|
|
562
579
|
}
|
|
563
|
-
|
|
580
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
581
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
564
582
|
}
|
|
565
583
|
const segment = this.captureSegment(captureStart, captureEnd, false);
|
|
566
584
|
if (segment)
|
|
@@ -571,24 +589,25 @@ export class LoaderState {
|
|
|
571
589
|
return { tag, anchor, kind: "scalar", result };
|
|
572
590
|
}
|
|
573
591
|
readSingleQuotedScalar(tag, anchor, nodeIndent) {
|
|
574
|
-
let ch = this.peek();
|
|
592
|
+
let ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
575
593
|
if (ch !== SINGLE_QUOTE)
|
|
576
594
|
return;
|
|
577
595
|
let result = "";
|
|
578
|
-
this.
|
|
579
|
-
let captureStart = this.position;
|
|
580
|
-
let captureEnd = this.position;
|
|
581
|
-
ch = this.peek();
|
|
596
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
597
|
+
let captureStart = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
598
|
+
let captureEnd = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
599
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
582
600
|
while (ch !== 0) {
|
|
583
601
|
if (ch === SINGLE_QUOTE) {
|
|
584
|
-
const segment = this.captureSegment(captureStart, this.position, true);
|
|
602
|
+
const segment = this.captureSegment(captureStart, __classPrivateFieldGet(this, _LoaderState_scanner, "f").position, true);
|
|
585
603
|
if (segment)
|
|
586
604
|
result += segment;
|
|
587
|
-
|
|
605
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
606
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
588
607
|
if (ch === SINGLE_QUOTE) {
|
|
589
|
-
captureStart = this.position;
|
|
590
|
-
this.
|
|
591
|
-
captureEnd = this.position;
|
|
608
|
+
captureStart = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
609
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
610
|
+
captureEnd = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
592
611
|
}
|
|
593
612
|
else {
|
|
594
613
|
if (anchor !== null)
|
|
@@ -601,57 +620,59 @@ export class LoaderState {
|
|
|
601
620
|
if (segment)
|
|
602
621
|
result += segment;
|
|
603
622
|
result += writeFoldedLines(this.skipSeparationSpace(false, nodeIndent));
|
|
604
|
-
captureStart = captureEnd = this.position;
|
|
623
|
+
captureStart = captureEnd = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
605
624
|
}
|
|
606
|
-
else if (this.position === this.lineStart &&
|
|
625
|
+
else if (__classPrivateFieldGet(this, _LoaderState_scanner, "f").position === this.lineStart &&
|
|
607
626
|
this.testDocumentSeparator()) {
|
|
608
627
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Unexpected end of the document within a single quoted scalar");
|
|
609
628
|
}
|
|
610
629
|
else {
|
|
611
|
-
this.
|
|
612
|
-
captureEnd = this.position;
|
|
630
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
631
|
+
captureEnd = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
613
632
|
}
|
|
614
|
-
ch = this.peek();
|
|
633
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
615
634
|
}
|
|
616
635
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Unexpected end of the stream within a single quoted scalar");
|
|
617
636
|
}
|
|
618
637
|
readDoubleQuotedScalar(tag, anchor, nodeIndent) {
|
|
619
|
-
let ch = this.peek();
|
|
638
|
+
let ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
620
639
|
if (ch !== DOUBLE_QUOTE)
|
|
621
640
|
return;
|
|
622
641
|
let result = "";
|
|
623
|
-
this.
|
|
624
|
-
let captureEnd = this.position;
|
|
625
|
-
let captureStart = this.position;
|
|
642
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
643
|
+
let captureEnd = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
644
|
+
let captureStart = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
626
645
|
let tmp;
|
|
627
|
-
ch = this.peek();
|
|
646
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
628
647
|
while (ch !== 0) {
|
|
629
648
|
if (ch === DOUBLE_QUOTE) {
|
|
630
|
-
const segment = this.captureSegment(captureStart, this.position, true);
|
|
649
|
+
const segment = this.captureSegment(captureStart, __classPrivateFieldGet(this, _LoaderState_scanner, "f").position, true);
|
|
631
650
|
if (segment)
|
|
632
651
|
result += segment;
|
|
633
|
-
this.
|
|
652
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
634
653
|
if (anchor !== null)
|
|
635
654
|
this.anchorMap.set(anchor, result);
|
|
636
655
|
return { tag, anchor, kind: "scalar", result };
|
|
637
656
|
}
|
|
638
657
|
if (ch === BACKSLASH) {
|
|
639
|
-
const segment = this.captureSegment(captureStart, this.position, true);
|
|
658
|
+
const segment = this.captureSegment(captureStart, __classPrivateFieldGet(this, _LoaderState_scanner, "f").position, true);
|
|
640
659
|
if (segment)
|
|
641
660
|
result += segment;
|
|
642
|
-
|
|
661
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
662
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
643
663
|
if (isEOL(ch)) {
|
|
644
664
|
this.skipSeparationSpace(false, nodeIndent);
|
|
645
665
|
}
|
|
646
666
|
else if (ch < 256 && SIMPLE_ESCAPE_SEQUENCES.has(ch)) {
|
|
647
667
|
result += SIMPLE_ESCAPE_SEQUENCES.get(ch);
|
|
648
|
-
this.
|
|
668
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
649
669
|
}
|
|
650
670
|
else if ((tmp = ESCAPED_HEX_LENGTHS.get(ch) ?? 0) > 0) {
|
|
651
671
|
let hexLength = tmp;
|
|
652
672
|
let hexResult = 0;
|
|
653
673
|
for (; hexLength > 0; hexLength--) {
|
|
654
|
-
|
|
674
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
675
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
655
676
|
if ((tmp = hexCharCodeToNumber(ch)) >= 0) {
|
|
656
677
|
hexResult = (hexResult << 4) + tmp;
|
|
657
678
|
}
|
|
@@ -660,34 +681,34 @@ export class LoaderState {
|
|
|
660
681
|
}
|
|
661
682
|
}
|
|
662
683
|
result += codepointToChar(hexResult);
|
|
663
|
-
this.
|
|
684
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
664
685
|
}
|
|
665
686
|
else {
|
|
666
687
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Cannot read double quoted scalar: unknown escape sequence");
|
|
667
688
|
}
|
|
668
|
-
captureStart = captureEnd = this.position;
|
|
689
|
+
captureStart = captureEnd = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
669
690
|
}
|
|
670
691
|
else if (isEOL(ch)) {
|
|
671
692
|
const segment = this.captureSegment(captureStart, captureEnd, true);
|
|
672
693
|
if (segment)
|
|
673
694
|
result += segment;
|
|
674
695
|
result += writeFoldedLines(this.skipSeparationSpace(false, nodeIndent));
|
|
675
|
-
captureStart = captureEnd = this.position;
|
|
696
|
+
captureStart = captureEnd = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
676
697
|
}
|
|
677
|
-
else if (this.position === this.lineStart &&
|
|
698
|
+
else if (__classPrivateFieldGet(this, _LoaderState_scanner, "f").position === this.lineStart &&
|
|
678
699
|
this.testDocumentSeparator()) {
|
|
679
700
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Unexpected end of the document within a double quoted scalar");
|
|
680
701
|
}
|
|
681
702
|
else {
|
|
682
|
-
this.
|
|
683
|
-
captureEnd = this.position;
|
|
703
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
704
|
+
captureEnd = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
684
705
|
}
|
|
685
|
-
ch = this.peek();
|
|
706
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
686
707
|
}
|
|
687
708
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Unexpected end of the stream within a double quoted scalar");
|
|
688
709
|
}
|
|
689
710
|
readFlowCollection(tag, anchor, nodeIndent) {
|
|
690
|
-
let ch = this.peek();
|
|
711
|
+
let ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
691
712
|
let terminator;
|
|
692
713
|
let isMapping = true;
|
|
693
714
|
let result = {};
|
|
@@ -704,7 +725,8 @@ export class LoaderState {
|
|
|
704
725
|
}
|
|
705
726
|
if (anchor !== null)
|
|
706
727
|
this.anchorMap.set(anchor, result);
|
|
707
|
-
|
|
728
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
729
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
708
730
|
let readNext = true;
|
|
709
731
|
let valueNode = null;
|
|
710
732
|
let keyNode = null;
|
|
@@ -716,9 +738,9 @@ export class LoaderState {
|
|
|
716
738
|
const overridableKeys = new Set();
|
|
717
739
|
while (ch !== 0) {
|
|
718
740
|
this.skipSeparationSpace(true, nodeIndent);
|
|
719
|
-
ch = this.peek();
|
|
741
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
720
742
|
if (ch === terminator) {
|
|
721
|
-
this.
|
|
743
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
722
744
|
const kind = isMapping ? "mapping" : "sequence";
|
|
723
745
|
return { tag, anchor, kind, result };
|
|
724
746
|
}
|
|
@@ -728,10 +750,10 @@ export class LoaderState {
|
|
|
728
750
|
keyTag = keyNode = valueNode = null;
|
|
729
751
|
isPair = isExplicitPair = false;
|
|
730
752
|
if (ch === QUESTION) {
|
|
731
|
-
following = this.peek(1);
|
|
753
|
+
following = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek(1);
|
|
732
754
|
if (isWhiteSpaceOrEOL(following)) {
|
|
733
755
|
isPair = isExplicitPair = true;
|
|
734
|
-
this.
|
|
756
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
735
757
|
this.skipSeparationSpace(true, nodeIndent);
|
|
736
758
|
}
|
|
737
759
|
}
|
|
@@ -747,10 +769,11 @@ export class LoaderState {
|
|
|
747
769
|
keyNode = newState.result;
|
|
748
770
|
}
|
|
749
771
|
this.skipSeparationSpace(true, nodeIndent);
|
|
750
|
-
ch = this.peek();
|
|
772
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
751
773
|
if ((isExplicitPair || this.line === line) && ch === COLON) {
|
|
752
774
|
isPair = true;
|
|
753
|
-
|
|
775
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
776
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
754
777
|
this.skipSeparationSpace(true, nodeIndent);
|
|
755
778
|
const newState = this.composeNode({
|
|
756
779
|
parentIndent: nodeIndent,
|
|
@@ -771,10 +794,11 @@ export class LoaderState {
|
|
|
771
794
|
result.push(keyNode);
|
|
772
795
|
}
|
|
773
796
|
this.skipSeparationSpace(true, nodeIndent);
|
|
774
|
-
ch = this.peek();
|
|
797
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
775
798
|
if (ch === COMMA) {
|
|
776
799
|
readNext = true;
|
|
777
|
-
|
|
800
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
801
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
778
802
|
}
|
|
779
803
|
else {
|
|
780
804
|
readNext = false;
|
|
@@ -791,7 +815,7 @@ export class LoaderState {
|
|
|
791
815
|
let textIndent = nodeIndent;
|
|
792
816
|
let emptyLines = 0;
|
|
793
817
|
let atMoreIndented = false;
|
|
794
|
-
let ch = this.peek();
|
|
818
|
+
let ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
795
819
|
let folding = false;
|
|
796
820
|
if (ch === VERTICAL_LINE) {
|
|
797
821
|
folding = false;
|
|
@@ -805,7 +829,8 @@ export class LoaderState {
|
|
|
805
829
|
let result = "";
|
|
806
830
|
let tmp = 0;
|
|
807
831
|
while (ch !== 0) {
|
|
808
|
-
|
|
832
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
833
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
809
834
|
if (ch === PLUS || ch === MINUS) {
|
|
810
835
|
if (CHOMPING_CLIP === chomping) {
|
|
811
836
|
chomping = ch === PLUS ? CHOMPING_KEEP : CHOMPING_STRIP;
|
|
@@ -833,16 +858,17 @@ export class LoaderState {
|
|
|
833
858
|
if (isWhiteSpace(ch)) {
|
|
834
859
|
this.skipWhitespaces();
|
|
835
860
|
this.skipComment();
|
|
836
|
-
ch = this.peek();
|
|
861
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
837
862
|
}
|
|
838
863
|
while (ch !== 0) {
|
|
839
864
|
this.readLineBreak();
|
|
840
865
|
this.lineIndent = 0;
|
|
841
|
-
ch = this.peek();
|
|
866
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
842
867
|
while ((!detectedIndent || this.lineIndent < textIndent) &&
|
|
843
868
|
ch === SPACE) {
|
|
844
869
|
this.lineIndent++;
|
|
845
|
-
|
|
870
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
871
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
846
872
|
}
|
|
847
873
|
if (!detectedIndent && this.lineIndent > textIndent) {
|
|
848
874
|
textIndent = this.lineIndent;
|
|
@@ -899,11 +925,12 @@ export class LoaderState {
|
|
|
899
925
|
didReadContent = true;
|
|
900
926
|
detectedIndent = true;
|
|
901
927
|
emptyLines = 0;
|
|
902
|
-
const captureStart = this.position;
|
|
928
|
+
const captureStart = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
903
929
|
while (!isEOL(ch) && ch !== 0) {
|
|
904
|
-
|
|
930
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
931
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
905
932
|
}
|
|
906
|
-
const segment = this.captureSegment(captureStart, this.position, false);
|
|
933
|
+
const segment = this.captureSegment(captureStart, __classPrivateFieldGet(this, _LoaderState_scanner, "f").position, false);
|
|
907
934
|
if (segment)
|
|
908
935
|
result += segment;
|
|
909
936
|
}
|
|
@@ -924,11 +951,11 @@ export class LoaderState {
|
|
|
924
951
|
let detected = false;
|
|
925
952
|
if (anchor !== null)
|
|
926
953
|
this.anchorMap.set(anchor, result);
|
|
927
|
-
let ch = this.peek();
|
|
954
|
+
let ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
928
955
|
while (ch !== 0) {
|
|
929
|
-
const following = this.peek(1);
|
|
956
|
+
const following = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek(1);
|
|
930
957
|
line = this.line; // Save the current line.
|
|
931
|
-
pos = this.position;
|
|
958
|
+
pos = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
932
959
|
//
|
|
933
960
|
// Explicit notation case. There are two separate blocks:
|
|
934
961
|
// first for the key (denoted by "?") and second for the value (denoted by ":")
|
|
@@ -953,7 +980,7 @@ export class LoaderState {
|
|
|
953
980
|
else {
|
|
954
981
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Cannot read block as explicit mapping pair is incomplete: a key node is missed or followed by a non-tabulated empty line");
|
|
955
982
|
}
|
|
956
|
-
this
|
|
983
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
957
984
|
ch = following;
|
|
958
985
|
//
|
|
959
986
|
// Implicit notation case. Flow-style node as the key first, then ":", and the value.
|
|
@@ -969,11 +996,12 @@ export class LoaderState {
|
|
|
969
996
|
if (!newState)
|
|
970
997
|
break; // Reading is done. Go to the epilogue.
|
|
971
998
|
if (this.line === line) {
|
|
972
|
-
ch = this.peek();
|
|
999
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
973
1000
|
this.skipWhitespaces();
|
|
974
|
-
ch = this.peek();
|
|
1001
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
975
1002
|
if (ch === COLON) {
|
|
976
|
-
|
|
1003
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
1004
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
977
1005
|
if (!isWhiteSpaceOrEOL(ch)) {
|
|
978
1006
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Cannot read block: a whitespace character is expected after the key-value separator within a block mapping");
|
|
979
1007
|
}
|
|
@@ -1028,7 +1056,7 @@ export class LoaderState {
|
|
|
1028
1056
|
keyTag = keyNode = valueNode = null;
|
|
1029
1057
|
}
|
|
1030
1058
|
this.skipSeparationSpace(true, -1);
|
|
1031
|
-
ch = this.peek();
|
|
1059
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1032
1060
|
}
|
|
1033
1061
|
if (this.lineIndent > nodeIndent && ch !== 0) {
|
|
1034
1062
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Cannot read block: bad indentation of a mapping entry");
|
|
@@ -1053,33 +1081,38 @@ export class LoaderState {
|
|
|
1053
1081
|
let isNamed = false;
|
|
1054
1082
|
let tagHandle = "";
|
|
1055
1083
|
let tagName;
|
|
1056
|
-
let ch = this.peek();
|
|
1084
|
+
let ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1057
1085
|
if (ch !== EXCLAMATION)
|
|
1058
1086
|
return;
|
|
1059
1087
|
if (tag !== null) {
|
|
1060
1088
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Cannot read tag property: duplication of a tag property");
|
|
1061
1089
|
}
|
|
1062
|
-
|
|
1090
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
1091
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1063
1092
|
if (ch === SMALLER_THAN) {
|
|
1064
1093
|
isVerbatim = true;
|
|
1065
|
-
|
|
1094
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
1095
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1066
1096
|
}
|
|
1067
1097
|
else if (ch === EXCLAMATION) {
|
|
1068
1098
|
isNamed = true;
|
|
1069
1099
|
tagHandle = "!!";
|
|
1070
|
-
|
|
1100
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
1101
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1071
1102
|
}
|
|
1072
1103
|
else {
|
|
1073
1104
|
tagHandle = "!";
|
|
1074
1105
|
}
|
|
1075
|
-
let position = this.position;
|
|
1106
|
+
let position = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
1076
1107
|
if (isVerbatim) {
|
|
1077
1108
|
do {
|
|
1078
|
-
|
|
1109
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
1110
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1079
1111
|
} while (ch !== 0 && ch !== GREATER_THAN);
|
|
1080
|
-
if (this
|
|
1081
|
-
tagName = this.
|
|
1082
|
-
|
|
1112
|
+
if (!__classPrivateFieldGet(this, _LoaderState_scanner, "f").eof()) {
|
|
1113
|
+
tagName = __classPrivateFieldGet(this, _LoaderState_scanner, "f").source.slice(position, __classPrivateFieldGet(this, _LoaderState_scanner, "f").position);
|
|
1114
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
1115
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1083
1116
|
}
|
|
1084
1117
|
else {
|
|
1085
1118
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Cannot read tag property: unexpected end of stream");
|
|
@@ -1089,20 +1122,21 @@ export class LoaderState {
|
|
|
1089
1122
|
while (ch !== 0 && !isWhiteSpaceOrEOL(ch)) {
|
|
1090
1123
|
if (ch === EXCLAMATION) {
|
|
1091
1124
|
if (!isNamed) {
|
|
1092
|
-
tagHandle = this.
|
|
1125
|
+
tagHandle = __classPrivateFieldGet(this, _LoaderState_scanner, "f").source.slice(position - 1, __classPrivateFieldGet(this, _LoaderState_scanner, "f").position + 1);
|
|
1093
1126
|
if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
|
|
1094
1127
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Cannot read tag property: named tag handle contains invalid characters");
|
|
1095
1128
|
}
|
|
1096
1129
|
isNamed = true;
|
|
1097
|
-
position = this.position + 1;
|
|
1130
|
+
position = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position + 1;
|
|
1098
1131
|
}
|
|
1099
1132
|
else {
|
|
1100
1133
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Cannot read tag property: tag suffix cannot contain an exclamation mark");
|
|
1101
1134
|
}
|
|
1102
1135
|
}
|
|
1103
|
-
|
|
1136
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
1137
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1104
1138
|
}
|
|
1105
|
-
tagName = this.
|
|
1139
|
+
tagName = __classPrivateFieldGet(this, _LoaderState_scanner, "f").source.slice(position, __classPrivateFieldGet(this, _LoaderState_scanner, "f").position);
|
|
1106
1140
|
if (PATTERN_FLOW_INDICATORS.test(tagName)) {
|
|
1107
1141
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Cannot read tag property: tag suffix cannot contain flow indicator characters");
|
|
1108
1142
|
}
|
|
@@ -1125,34 +1159,38 @@ export class LoaderState {
|
|
|
1125
1159
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, `Cannot read tag property: undeclared tag handle "${tagHandle}"`);
|
|
1126
1160
|
}
|
|
1127
1161
|
readAnchorProperty(anchor) {
|
|
1128
|
-
let ch = this.peek();
|
|
1162
|
+
let ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1129
1163
|
if (ch !== AMPERSAND)
|
|
1130
1164
|
return;
|
|
1131
1165
|
if (anchor !== null) {
|
|
1132
1166
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Cannot read anchor property: duplicate anchor property");
|
|
1133
1167
|
}
|
|
1134
|
-
|
|
1135
|
-
|
|
1168
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
1169
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1170
|
+
const position = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
1136
1171
|
while (ch !== 0 && !isWhiteSpaceOrEOL(ch) && !isFlowIndicator(ch)) {
|
|
1137
|
-
|
|
1172
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
1173
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1138
1174
|
}
|
|
1139
|
-
if (this.position === position) {
|
|
1175
|
+
if (__classPrivateFieldGet(this, _LoaderState_scanner, "f").position === position) {
|
|
1140
1176
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Cannot read anchor property: name of an anchor node must contain at least one character");
|
|
1141
1177
|
}
|
|
1142
|
-
return this.
|
|
1178
|
+
return __classPrivateFieldGet(this, _LoaderState_scanner, "f").source.slice(position, __classPrivateFieldGet(this, _LoaderState_scanner, "f").position);
|
|
1143
1179
|
}
|
|
1144
1180
|
readAlias() {
|
|
1145
|
-
if (this.peek() !== ASTERISK)
|
|
1181
|
+
if (__classPrivateFieldGet(this, _LoaderState_scanner, "f").peek() !== ASTERISK)
|
|
1146
1182
|
return;
|
|
1147
|
-
|
|
1148
|
-
|
|
1183
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
1184
|
+
let ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1185
|
+
const position = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
1149
1186
|
while (ch !== 0 && !isWhiteSpaceOrEOL(ch) && !isFlowIndicator(ch)) {
|
|
1150
|
-
|
|
1187
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
1188
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1151
1189
|
}
|
|
1152
|
-
if (this.position === position) {
|
|
1190
|
+
if (__classPrivateFieldGet(this, _LoaderState_scanner, "f").position === position) {
|
|
1153
1191
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Cannot read alias: alias name must contain at least one character");
|
|
1154
1192
|
}
|
|
1155
|
-
const alias = this.
|
|
1193
|
+
const alias = __classPrivateFieldGet(this, _LoaderState_scanner, "f").source.slice(position, __classPrivateFieldGet(this, _LoaderState_scanner, "f").position);
|
|
1156
1194
|
if (!this.anchorMap.has(alias)) {
|
|
1157
1195
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, `Cannot read alias: unidentified alias "${alias}"`);
|
|
1158
1196
|
}
|
|
@@ -1248,7 +1286,7 @@ export class LoaderState {
|
|
|
1248
1286
|
CONTEXT_FLOW_OUT === nodeContext;
|
|
1249
1287
|
const flowIndent = cond ? parentIndent : parentIndent + 1;
|
|
1250
1288
|
if (allowBlockCollections) {
|
|
1251
|
-
const blockIndent = this.position - this.lineStart;
|
|
1289
|
+
const blockIndent = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position - this.lineStart;
|
|
1252
1290
|
const blockSequenceState = this.readBlockSequence(tag, anchor, blockIndent);
|
|
1253
1291
|
if (blockSequenceState)
|
|
1254
1292
|
return this.resolveTag(blockSequenceState);
|
|
@@ -1288,7 +1326,7 @@ export class LoaderState {
|
|
|
1288
1326
|
allowBlockCollections) {
|
|
1289
1327
|
// Special case: block sequences are allowed to have same indentation level as the parent.
|
|
1290
1328
|
// http://www.yaml.org/spec/1.2/spec.html#id2799784
|
|
1291
|
-
const blockIndent = this.position - this.lineStart;
|
|
1329
|
+
const blockIndent = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position - this.lineStart;
|
|
1292
1330
|
const newState = this.readBlockSequence(tag, anchor, blockIndent);
|
|
1293
1331
|
if (newState)
|
|
1294
1332
|
return this.resolveTag(newState);
|
|
@@ -1300,20 +1338,22 @@ export class LoaderState {
|
|
|
1300
1338
|
readDirectives() {
|
|
1301
1339
|
let hasDirectives = false;
|
|
1302
1340
|
let version = null;
|
|
1303
|
-
let ch = this.peek();
|
|
1341
|
+
let ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1304
1342
|
while (ch !== 0) {
|
|
1305
1343
|
this.skipSeparationSpace(true, -1);
|
|
1306
|
-
ch = this.peek();
|
|
1344
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1307
1345
|
if (this.lineIndent > 0 || ch !== PERCENT) {
|
|
1308
1346
|
break;
|
|
1309
1347
|
}
|
|
1310
1348
|
hasDirectives = true;
|
|
1311
|
-
|
|
1312
|
-
|
|
1349
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
1350
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1351
|
+
let position = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
1313
1352
|
while (ch !== 0 && !isWhiteSpaceOrEOL(ch)) {
|
|
1314
|
-
|
|
1353
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
1354
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1315
1355
|
}
|
|
1316
|
-
const directiveName = this.
|
|
1356
|
+
const directiveName = __classPrivateFieldGet(this, _LoaderState_scanner, "f").source.slice(position, __classPrivateFieldGet(this, _LoaderState_scanner, "f").position);
|
|
1317
1357
|
const directiveArgs = [];
|
|
1318
1358
|
if (directiveName.length < 1) {
|
|
1319
1359
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Cannot read document: directive name length must be greater than zero");
|
|
@@ -1321,14 +1361,15 @@ export class LoaderState {
|
|
|
1321
1361
|
while (ch !== 0) {
|
|
1322
1362
|
this.skipWhitespaces();
|
|
1323
1363
|
this.skipComment();
|
|
1324
|
-
ch = this.peek();
|
|
1364
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1325
1365
|
if (isEOL(ch))
|
|
1326
1366
|
break;
|
|
1327
|
-
position = this.position;
|
|
1367
|
+
position = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
1328
1368
|
while (ch !== 0 && !isWhiteSpaceOrEOL(ch)) {
|
|
1329
|
-
|
|
1369
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").next();
|
|
1370
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1330
1371
|
}
|
|
1331
|
-
directiveArgs.push(this.
|
|
1372
|
+
directiveArgs.push(__classPrivateFieldGet(this, _LoaderState_scanner, "f").source.slice(position, __classPrivateFieldGet(this, _LoaderState_scanner, "f").position));
|
|
1332
1373
|
}
|
|
1333
1374
|
if (ch !== 0)
|
|
1334
1375
|
this.readLineBreak();
|
|
@@ -1346,12 +1387,12 @@ export class LoaderState {
|
|
|
1346
1387
|
this.dispatchWarning(`unknown document directive "${directiveName}"`);
|
|
1347
1388
|
break;
|
|
1348
1389
|
}
|
|
1349
|
-
ch = this.peek();
|
|
1390
|
+
ch = __classPrivateFieldGet(this, _LoaderState_scanner, "f").peek();
|
|
1350
1391
|
}
|
|
1351
1392
|
return hasDirectives;
|
|
1352
1393
|
}
|
|
1353
1394
|
readDocument() {
|
|
1354
|
-
const documentStart = this.position;
|
|
1395
|
+
const documentStart = __classPrivateFieldGet(this, _LoaderState_scanner, "f").position;
|
|
1355
1396
|
this.checkLineBreaks = false;
|
|
1356
1397
|
this.tagMap = new Map();
|
|
1357
1398
|
this.anchorMap = new Map();
|
|
@@ -1359,10 +1400,10 @@ export class LoaderState {
|
|
|
1359
1400
|
this.skipSeparationSpace(true, -1);
|
|
1360
1401
|
let result = null;
|
|
1361
1402
|
if (this.lineIndent === 0 &&
|
|
1362
|
-
this.peek() === MINUS &&
|
|
1363
|
-
this.peek(1) === MINUS &&
|
|
1364
|
-
this.peek(2) === MINUS) {
|
|
1365
|
-
this.position += 3;
|
|
1403
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").peek() === MINUS &&
|
|
1404
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").peek(1) === MINUS &&
|
|
1405
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").peek(2) === MINUS) {
|
|
1406
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").position += 3;
|
|
1366
1407
|
this.skipSeparationSpace(true, -1);
|
|
1367
1408
|
}
|
|
1368
1409
|
else if (hasDirectives) {
|
|
@@ -1378,27 +1419,27 @@ export class LoaderState {
|
|
|
1378
1419
|
result = newState.result;
|
|
1379
1420
|
this.skipSeparationSpace(true, -1);
|
|
1380
1421
|
if (this.checkLineBreaks &&
|
|
1381
|
-
PATTERN_NON_ASCII_LINE_BREAKS.test(this.
|
|
1422
|
+
PATTERN_NON_ASCII_LINE_BREAKS.test(__classPrivateFieldGet(this, _LoaderState_scanner, "f").source.slice(documentStart, __classPrivateFieldGet(this, _LoaderState_scanner, "f").position))) {
|
|
1382
1423
|
this.dispatchWarning("non-ASCII line breaks are interpreted as content");
|
|
1383
1424
|
}
|
|
1384
|
-
if (this.position === this.lineStart && this.testDocumentSeparator()) {
|
|
1385
|
-
if (this.peek() === DOT) {
|
|
1386
|
-
this.position += 3;
|
|
1425
|
+
if (__classPrivateFieldGet(this, _LoaderState_scanner, "f").position === this.lineStart && this.testDocumentSeparator()) {
|
|
1426
|
+
if (__classPrivateFieldGet(this, _LoaderState_scanner, "f").peek() === DOT) {
|
|
1427
|
+
__classPrivateFieldGet(this, _LoaderState_scanner, "f").position += 3;
|
|
1387
1428
|
this.skipSeparationSpace(true, -1);
|
|
1388
1429
|
}
|
|
1389
1430
|
}
|
|
1390
|
-
else if (this
|
|
1431
|
+
else if (!__classPrivateFieldGet(this, _LoaderState_scanner, "f").eof()) {
|
|
1391
1432
|
throw __classPrivateFieldGet(this, _LoaderState_instances, "m", _LoaderState_createError).call(this, "Cannot read document: end of the stream or a document separator is expected");
|
|
1392
1433
|
}
|
|
1393
1434
|
return result;
|
|
1394
1435
|
}
|
|
1395
1436
|
*readDocuments() {
|
|
1396
|
-
while (this
|
|
1437
|
+
while (!__classPrivateFieldGet(this, _LoaderState_scanner, "f").eof()) {
|
|
1397
1438
|
yield this.readDocument();
|
|
1398
1439
|
}
|
|
1399
1440
|
}
|
|
1400
1441
|
}
|
|
1401
|
-
_LoaderState_instances = new WeakSet(), _LoaderState_createError = function _LoaderState_createError(message) {
|
|
1402
|
-
const mark = markToString(this.
|
|
1442
|
+
_LoaderState_scanner = new WeakMap(), _LoaderState_instances = new WeakSet(), _LoaderState_createError = function _LoaderState_createError(message) {
|
|
1443
|
+
const mark = markToString(__classPrivateFieldGet(this, _LoaderState_scanner, "f").source, __classPrivateFieldGet(this, _LoaderState_scanner, "f").position, this.line, __classPrivateFieldGet(this, _LoaderState_scanner, "f").position - this.lineStart);
|
|
1403
1444
|
return new SyntaxError(`${message} ${mark}`);
|
|
1404
1445
|
};
|