@tsplc/typegen 0.2.17 → 0.2.19

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.
@@ -1,329 +1,400 @@
1
+ import {
2
+ blockCommentEnd,
3
+ directAddressEnd,
4
+ identifierPattern,
5
+ lineCommentEnd,
6
+ qualifiers,
7
+ } from "@tsplc/iec/st";
8
+
1
9
  export interface Source {
2
- name: string;
3
- text: string;
10
+ name: string;
11
+ text: string;
4
12
  }
5
13
 
6
14
  export type TypeReference =
7
- | { kind: "named"; name: string }
8
- | { kind: "string"; name: "STRING" | "WSTRING"; length: string }
9
- | {
10
- kind: "array";
11
- dimensions: Array<{ lower: string; upper: string }>;
12
- element: TypeReference;
13
- };
15
+ | { kind: "named"; name: string }
16
+ | { kind: "string"; name: "STRING" | "WSTRING"; length: string }
17
+ | {
18
+ kind: "array";
19
+ dimensions: { lower: string; upper: string }[];
20
+ element: TypeReference;
21
+ };
14
22
 
15
23
  export interface Member {
16
- name: string;
17
- description: string;
18
- type: TypeReference;
19
- initial?: string;
20
- /** A CODESYS symbol attribute explicitly publishes this global for clients. */
21
- published?: boolean;
24
+ name: string;
25
+ description: string;
26
+ type: TypeReference;
27
+ initial?: string;
28
+ /** A CODESYS symbol attribute explicitly publishes this global for clients. */
29
+ published?: boolean;
22
30
  }
23
31
 
24
32
  export type Declaration = {
25
- name: string;
26
- description: string;
27
- source: string;
33
+ name: string;
34
+ description: string;
35
+ source: string;
28
36
  } & (
29
- | { kind: "struct"; members: Member[] }
30
- | {
31
- kind: "alias";
32
- type: TypeReference;
33
- /** `{attribute 'tsplc_keyed'}`: an array whose indexes are enum keys, so each element is its own contract variable. */
34
- keyed?: boolean;
35
- }
36
- | {
37
- kind: "enum";
38
- members: Array<{ name: string; value?: string }>;
39
- base: string;
40
- }
37
+ | { kind: "struct"; members: Member[] }
38
+ | {
39
+ kind: "alias";
40
+ type: TypeReference;
41
+ /** `{attribute 'tsplc_keyed'}`: an array whose indexes are enum keys, so each element is its own contract variable. */
42
+ keyed?: boolean;
43
+ }
44
+ | {
45
+ kind: "enum";
46
+ members: { name: string; value?: string }[];
47
+ base: string;
48
+ }
41
49
  );
42
50
 
43
51
  export interface GlobalList {
44
- name: string;
45
- description: string;
46
- source: string;
47
- constant: boolean;
48
- members: Member[];
52
+ name: string;
53
+ description: string;
54
+ source: string;
55
+ constant: boolean;
56
+ members: Member[];
49
57
  }
50
58
 
51
59
  interface Token {
52
- text: string;
53
- offset: number;
54
- kind: "code" | "comment" | "attribute";
60
+ text: string;
61
+ offset: number;
62
+ kind: "code" | "comment" | "attribute";
55
63
  }
56
64
 
57
65
  function tokenize(source: Source): Token[] {
58
- const tokens: Token[] = [];
59
- let offset = 0;
60
- while (offset < source.text.length) {
61
- const rest = source.text.slice(offset);
62
- const whitespace = /^\s+/.exec(rest);
63
- if (whitespace) {
64
- offset += whitespace[0].length;
65
- continue;
66
- }
67
- if (rest.startsWith("(*")) {
68
- const start = offset;
69
- let depth = 1;
70
- offset += 2;
71
- while (depth && offset < source.text.length) {
72
- const pair = source.text.slice(offset, offset + 2);
73
- if (pair === "(*" || pair === "*)") {
74
- depth += pair === "(*" ? 1 : -1;
75
- offset += 2;
76
- } else offset++;
77
- }
78
- if (depth) throw new Error(`${source.name}: unterminated comment`);
79
- tokens.push({
80
- text: source.text.slice(start + 2, offset - 2).trim(),
81
- offset: start,
82
- kind: "comment",
83
- });
84
- continue;
85
- }
86
- const comment = /^\/\/[^\r\n]*/.exec(rest);
87
- if (comment) {
88
- tokens.push({
89
- text: comment[0].slice(2).trim(),
90
- offset,
91
- kind: "comment",
92
- });
93
- offset += comment[0].length;
94
- continue;
95
- }
96
- const attribute = /^\{(?:[^}'"]|'(?:\$[\s\S]|''|[^'])*'|"(?:\$[\s\S]|""|[^"])*")*\}/.exec(rest);
97
- if (attribute) {
98
- tokens.push({ text: attribute[0], offset, kind: "attribute" });
99
- offset += attribute[0].length;
100
- continue;
101
- }
102
- const code =
103
- /^(?:%[IQM](?:[XBWDL])?(?:\d+(?:\.\d+)*|\*)|'(?:\$[\s\S]|''|[^'])*'|"(?:\$[\s\S]|""|[^"])*"|\d[\d_]*#[\da-fA-F_]+|\d[\d_]*(?:\.(?!\.)[\d_]+)?(?:[eE][+-]?\d+)?|[A-Za-z_]\w*|:=|\.\.|[[\]():;,.+\-*/#])/i.exec(
104
- rest,
105
- );
106
- if (!code)
107
- throw new Error(
108
- `${source.name}:${source.text.slice(0, offset).split("\n").length}: unsupported token ${JSON.stringify(rest.slice(0, 24))}`,
109
- );
110
- tokens.push({ text: code[0], offset, kind: "code" });
111
- offset += code[0].length;
112
- }
113
- return tokens;
66
+ const tokens: Token[] = [];
67
+ let offset = 0;
68
+ while (offset < source.text.length) {
69
+ const rest = source.text.slice(offset);
70
+ const whitespace = /^\s+/.exec(rest);
71
+ if (whitespace) {
72
+ offset += whitespace[0].length;
73
+ continue;
74
+ }
75
+ if (rest.startsWith("(*")) {
76
+ const end = blockCommentEnd(source.text, offset);
77
+ if (end === null) {
78
+ throw new Error(`${source.name}: unterminated comment`);
79
+ }
80
+ tokens.push({
81
+ text: source.text.slice(offset + 2, end - 2).trim(),
82
+ offset,
83
+ kind: "comment",
84
+ });
85
+ offset = end;
86
+ continue;
87
+ }
88
+ if (rest.startsWith("//")) {
89
+ const end = lineCommentEnd(source.text, offset);
90
+ tokens.push({
91
+ text: source.text.slice(offset + 2, end).trim(),
92
+ offset,
93
+ kind: "comment",
94
+ });
95
+ offset = end;
96
+ continue;
97
+ }
98
+ const attribute =
99
+ /^\{(?:[^}'"]|'(?:\$[\s\S]|''|[^'])*'|"(?:\$[\s\S]|""|[^"])*")*\}/.exec(
100
+ rest,
101
+ );
102
+ if (attribute) {
103
+ tokens.push({ text: attribute[0], offset, kind: "attribute" });
104
+ offset += attribute[0].length;
105
+ continue;
106
+ }
107
+ const addressEnd = directAddressEnd(source.text, offset);
108
+ if (addressEnd !== null) {
109
+ tokens.push({
110
+ text: source.text.slice(offset, addressEnd),
111
+ offset,
112
+ kind: "code",
113
+ });
114
+ offset = addressEnd;
115
+ continue;
116
+ }
117
+ const code =
118
+ /^(?:'(?:\$[\s\S]|''|[^'])*'|"(?:\$[\s\S]|""|[^"])*"|\d[\d_]*#[\da-fA-F_]+|\d[\d_]*(?:\.(?!\.)[\d_]+)?(?:[eE][+-]?\d+)?|[A-Za-z_]\w*|:=|\.\.|[[\]():;,.+\-*/#])/i.exec(
119
+ rest,
120
+ );
121
+ if (!code) {
122
+ throw new Error(
123
+ `${source.name}:${source.text.slice(0, offset).split("\n").length}: unsupported token ${JSON.stringify(rest.slice(0, 24))}`,
124
+ );
125
+ }
126
+ tokens.push({ text: code[0], offset, kind: "code" });
127
+ offset += code[0].length;
128
+ }
129
+ return tokens;
114
130
  }
115
131
 
116
132
  class Parser {
117
- private position = 0;
118
- private readonly tokens: Token[];
119
- constructor(private readonly source: Source) {
120
- this.tokens = tokenize(source);
121
- }
133
+ private position = 0;
134
+ private readonly tokens: Token[];
135
+ constructor(private readonly source: Source) {
136
+ this.tokens = tokenize(source);
137
+ }
122
138
 
123
- private nextIndex(): number {
124
- let index = this.position;
125
- while (this.tokens[index] && this.tokens[index]!.kind !== "code") index++;
126
- return index;
127
- }
139
+ private nextIndex(): number {
140
+ let index = this.position;
141
+ while (index < this.tokens.length && this.tokens[index]?.kind !== "code") {
142
+ index++;
143
+ }
144
+ return index;
145
+ }
128
146
 
129
- peek(): string {
130
- return this.tokens[this.nextIndex()]?.text.toUpperCase() ?? "";
131
- }
147
+ peek(): string {
148
+ return this.tokens[this.nextIndex()]?.text.toUpperCase() ?? "";
149
+ }
132
150
 
133
- error(message: string): never {
134
- const offset = this.tokens[this.nextIndex()]?.offset ?? this.source.text.length;
135
- throw new Error(
136
- `${this.source.name}:${this.source.text.slice(0, offset).split("\n").length}: ${message}`,
137
- );
138
- }
151
+ error(message: string): never {
152
+ const offset =
153
+ this.tokens[this.nextIndex()]?.offset ?? this.source.text.length;
154
+ throw new Error(
155
+ `${this.source.name}:${this.source.text.slice(0, offset).split("\n").length}: ${message}`,
156
+ );
157
+ }
139
158
 
140
- private take(): string {
141
- this.position = this.nextIndex();
142
- const token = this.tokens[this.position++];
143
- if (!token) this.error("unexpected end of declaration");
144
- return token.text;
145
- }
159
+ private take(): string {
160
+ this.position = this.nextIndex();
161
+ const token = this.tokens[this.position++];
162
+ if (!token) {
163
+ this.error("unexpected end of declaration");
164
+ }
165
+ return token.text;
166
+ }
146
167
 
147
- private accept(value: string): boolean {
148
- if (this.peek() !== value) return false;
149
- this.take();
150
- return true;
151
- }
168
+ private accept(value: string): boolean {
169
+ if (this.peek() !== value) {
170
+ return false;
171
+ }
172
+ this.take();
173
+ return true;
174
+ }
152
175
 
153
- private expect(value: string): void {
154
- if (!this.accept(value)) this.error(`expected ${value}, found ${this.peek() || "end of file"}`);
155
- }
176
+ private expect(value: string): void {
177
+ if (!this.accept(value)) {
178
+ this.error(`expected ${value}, found ${this.peek() || "end of file"}`);
179
+ }
180
+ }
156
181
 
157
- private identifier(): string {
158
- const name = this.take();
159
- if (!/^[A-Za-z_]\w*$/.test(name)) this.error(`expected identifier, found ${name}`);
160
- return name;
161
- }
182
+ private identifier(): string {
183
+ const name = this.take();
184
+ if (!identifierPattern.test(name)) {
185
+ this.error(`expected identifier, found ${name}`);
186
+ }
187
+ return name;
188
+ }
162
189
 
163
- private documentation(): string {
164
- const end = this.nextIndex();
165
- const text = this.tokens
166
- .slice(this.position, end)
167
- .filter((token) => token.kind === "comment")
168
- .map((token) => token.text)
169
- .join("\n");
170
- this.position = end;
171
- return text;
172
- }
190
+ private documentation(): string {
191
+ const end = this.nextIndex();
192
+ const text = this.tokens
193
+ .slice(this.position, end)
194
+ .filter((token) => token.kind === "comment")
195
+ .map((token) => token.text)
196
+ .join("\n");
197
+ this.position = end;
198
+ return text;
199
+ }
173
200
 
174
- private expression(stops: string[]): string {
175
- const values: string[] = [];
176
- const closing: string[] = [];
177
- while (this.peek() && (closing.length || !stops.includes(this.peek()))) {
178
- const token = this.take();
179
- if (token === "(" || token === "[") closing.push(token === "(" ? ")" : "]");
180
- if (token === ")" || token === "]") {
181
- if (closing.pop() !== token) this.error(`unmatched ${token}`);
182
- }
183
- values.push(token);
184
- }
185
- if (!values.length || closing.length) this.error("incomplete expression");
186
- return values.join(" ");
187
- }
201
+ private expression(stops: string[]): string {
202
+ const values: string[] = [];
203
+ const closing: string[] = [];
204
+ while (this.peek() && (closing.length || !stops.includes(this.peek()))) {
205
+ const token = this.take();
206
+ if (token === "(" || token === "[") {
207
+ closing.push(token === "(" ? ")" : "]");
208
+ }
209
+ if (token === ")" || token === "]") {
210
+ if (closing.pop() !== token) {
211
+ this.error(`unmatched ${token}`);
212
+ }
213
+ }
214
+ values.push(token);
215
+ }
216
+ if (!values.length || closing.length) {
217
+ this.error("incomplete expression");
218
+ }
219
+ return values.join(" ");
220
+ }
188
221
 
189
- private reference(): TypeReference {
190
- if (this.accept("ARRAY")) {
191
- this.expect("[");
192
- const dimensions: Array<{ lower: string; upper: string }> = [];
193
- do {
194
- const lower = this.expression([".."]);
195
- this.expect("..");
196
- const upper = this.expression([",", "]"]);
197
- dimensions.push({ lower, upper });
198
- } while (this.accept(","));
199
- this.expect("]");
200
- this.expect("OF");
201
- return { kind: "array", dimensions, element: this.reference() };
202
- }
203
- const parts = [this.identifier()];
204
- while (this.accept(".")) parts.push(this.identifier());
205
- const name = parts.join(".");
206
- const upper = name.toUpperCase();
207
- if (upper === "STRING" || upper === "WSTRING") {
208
- const opening = this.peek();
209
- if (opening !== "(" && opening !== "[") return { kind: "string", name: upper, length: "80" };
210
- this.take();
211
- const closing = opening === "(" ? ")" : "]";
212
- const length = this.expression([closing]);
213
- this.expect(closing);
214
- return { kind: "string", name: upper, length };
215
- }
216
- return { kind: "named", name };
217
- }
222
+ private reference(): TypeReference {
223
+ if (this.accept("ARRAY")) {
224
+ this.expect("[");
225
+ const dimensions: { lower: string; upper: string }[] = [];
226
+ do {
227
+ const lower = this.expression([".."]);
228
+ this.expect("..");
229
+ const upper = this.expression([",", "]"]);
230
+ dimensions.push({ lower, upper });
231
+ } while (this.accept(","));
232
+ this.expect("]");
233
+ this.expect("OF");
234
+ return { kind: "array", dimensions, element: this.reference() };
235
+ }
236
+ const parts = [this.identifier()];
237
+ while (this.accept(".")) {
238
+ parts.push(this.identifier());
239
+ }
240
+ const name = parts.join(".");
241
+ const upper = name.toUpperCase();
242
+ if (upper === "STRING" || upper === "WSTRING") {
243
+ const opening = this.peek();
244
+ if (opening !== "(" && opening !== "[") {
245
+ return { kind: "string", name: upper, length: "80" };
246
+ }
247
+ this.take();
248
+ const closing = opening === "(" ? ")" : "]";
249
+ const length = this.expression([closing]);
250
+ this.expect(closing);
251
+ return { kind: "string", name: upper, length };
252
+ }
253
+ return { kind: "named", name };
254
+ }
218
255
 
219
- private members(end: string): Member[] {
220
- const members: Member[] = [];
221
- while (this.peek() !== end) {
222
- const published = this.tokens
223
- .slice(this.position, this.nextIndex())
224
- .some(
225
- (token) =>
226
- token.kind === "attribute" &&
227
- /^\{\s*attribute\s+'symbol'\s*:=\s*'(?:read|write|readwrite)'\s*\}$/i.test(token.text),
228
- );
229
- const description = this.documentation();
230
- const names = [this.identifier()];
231
- while (this.accept(",")) names.push(this.identifier());
232
- if (this.accept("AT")) {
233
- // Location belongs to the hardware/build mapping; it does not alter the
234
- // scalar type that application consumers receive from type generation.
235
- const address = this.take();
236
- if (!/^%[IQM](?:[XBWDL])?(?:\d+(?:\.\d+)*|\*)$/i.test(address))
237
- this.error(`expected direct address after AT, found ${address}`);
238
- }
239
- this.expect(":");
240
- const type = this.reference();
241
- const initial = this.accept(":=") ? this.expression([";"]) : undefined;
242
- this.expect(";");
243
- for (const name of names) {
244
- if (members.some((member) => member.name.toUpperCase() === name.toUpperCase()))
245
- this.error(`duplicate member ${name}`);
246
- members.push({
247
- name,
248
- description,
249
- type,
250
- ...(initial === undefined ? {} : { initial }),
251
- ...(published ? { published: true } : {}),
252
- });
253
- }
254
- }
255
- this.expect(end);
256
- return members;
257
- }
256
+ private members(end: string): Member[] {
257
+ const members: Member[] = [];
258
+ while (this.peek() !== end) {
259
+ const published = this.tokens
260
+ .slice(this.position, this.nextIndex())
261
+ .some(
262
+ (token) =>
263
+ token.kind === "attribute" &&
264
+ /^\{\s*attribute\s+'symbol'\s*:=\s*'(?:read|write|readwrite)'\s*\}$/i.test(
265
+ token.text,
266
+ ),
267
+ );
268
+ const description = this.documentation();
269
+ const names = [this.identifier()];
270
+ while (this.accept(",")) {
271
+ names.push(this.identifier());
272
+ }
273
+ if (this.accept("AT")) {
274
+ // Location belongs to the hardware/build mapping; it does not alter the
275
+ // scalar type that application consumers receive from type generation.
276
+ const address = this.take();
277
+ if (directAddressEnd(address, 0) !== address.length) {
278
+ this.error(`expected direct address after AT, found ${address}`);
279
+ }
280
+ }
281
+ this.expect(":");
282
+ const type = this.reference();
283
+ const initial = this.accept(":=") ? this.expression([";"]) : undefined;
284
+ this.expect(";");
285
+ for (const name of names) {
286
+ if (
287
+ members.some(
288
+ (member) => member.name.toUpperCase() === name.toUpperCase(),
289
+ )
290
+ ) {
291
+ this.error(`duplicate member ${name}`);
292
+ }
293
+ members.push({
294
+ name,
295
+ description,
296
+ type,
297
+ ...(initial === undefined ? {} : { initial }),
298
+ ...(published ? { published: true } : {}),
299
+ });
300
+ }
301
+ }
302
+ this.expect(end);
303
+ return members;
304
+ }
258
305
 
259
- declarations(): Declaration[] {
260
- const declarations: Declaration[] = [];
261
- while (this.peek()) {
262
- const keyed = this.tokens
263
- .slice(this.position, this.nextIndex())
264
- .some(
265
- (token) =>
266
- token.kind === "attribute" && /^\{\s*attribute\s+'tsplc_keyed'\s*\}$/i.test(token.text),
267
- );
268
- const description = this.documentation();
269
- this.expect("TYPE");
270
- const name = this.identifier();
271
- this.expect(":");
272
- const common = { name, description, source: this.source.name };
273
- if (this.accept("STRUCT")) {
274
- declarations.push({
275
- ...common,
276
- kind: "struct",
277
- members: this.members("END_STRUCT"),
278
- });
279
- this.accept(";");
280
- } else if (this.accept("(")) {
281
- const members: Array<{ name: string; value?: string }> = [];
282
- do {
283
- const member = this.identifier();
284
- const value = this.accept(":=") ? this.expression([",", ")"]) : undefined;
285
- if (members.some((item) => item.name.toUpperCase() === member.toUpperCase()))
286
- this.error(`duplicate enum member ${member}`);
287
- members.push({ name: member, value });
288
- } while (this.accept(",") && this.peek() !== ")");
289
- this.expect(")");
290
- const base = this.peek() === ";" ? "INT" : this.identifier().toUpperCase();
291
- this.expect(";");
292
- declarations.push({ ...common, kind: "enum", members, base });
293
- } else {
294
- const type = this.reference();
295
- this.expect(";");
296
- declarations.push({ ...common, kind: "alias", type, ...(keyed ? { keyed } : {}) });
297
- }
298
- this.expect("END_TYPE");
299
- this.accept(";");
300
- }
301
- if (!declarations.length) this.error("no TYPE declarations found");
302
- return declarations;
303
- }
306
+ declarations(): Declaration[] {
307
+ const declarations: Declaration[] = [];
308
+ while (this.peek()) {
309
+ const keyed = this.tokens
310
+ .slice(this.position, this.nextIndex())
311
+ .some(
312
+ (token) =>
313
+ token.kind === "attribute" &&
314
+ /^\{\s*attribute\s+'tsplc_keyed'\s*\}$/i.test(token.text),
315
+ );
316
+ const description = this.documentation();
317
+ this.expect("TYPE");
318
+ const name = this.identifier();
319
+ this.expect(":");
320
+ const common = { name, description, source: this.source.name };
321
+ if (this.accept("STRUCT")) {
322
+ declarations.push({
323
+ ...common,
324
+ kind: "struct",
325
+ members: this.members("END_STRUCT"),
326
+ });
327
+ this.accept(";");
328
+ } else if (this.accept("(")) {
329
+ const members: { name: string; value?: string }[] = [];
330
+ do {
331
+ const member = this.identifier();
332
+ const value = this.accept(":=")
333
+ ? this.expression([",", ")"])
334
+ : undefined;
335
+ if (
336
+ members.some(
337
+ (item) => item.name.toUpperCase() === member.toUpperCase(),
338
+ )
339
+ ) {
340
+ this.error(`duplicate enum member ${member}`);
341
+ }
342
+ members.push({ name: member, value });
343
+ } while (this.accept(",") && this.peek() !== ")");
344
+ this.expect(")");
345
+ const base =
346
+ this.peek() === ";" ? "INT" : this.identifier().toUpperCase();
347
+ this.expect(";");
348
+ declarations.push({ ...common, kind: "enum", members, base });
349
+ } else {
350
+ const type = this.reference();
351
+ this.expect(";");
352
+ declarations.push({
353
+ ...common,
354
+ kind: "alias",
355
+ type,
356
+ ...(keyed ? { keyed } : {}),
357
+ });
358
+ }
359
+ this.expect("END_TYPE");
360
+ this.accept(";");
361
+ }
362
+ if (!declarations.length) {
363
+ this.error("no TYPE declarations found");
364
+ }
365
+ return declarations;
366
+ }
304
367
 
305
- globals(name: string): GlobalList {
306
- const description = this.documentation();
307
- this.expect("VAR_GLOBAL");
308
- let constant = false;
309
- const qualifiers = new Set<string>();
310
- while (["CONSTANT", "RETAIN", "PERSISTENT"].includes(this.peek())) {
311
- const qualifier = this.take().toUpperCase();
312
- if (qualifiers.has(qualifier)) this.error(`duplicate ${qualifier} qualifier`);
313
- qualifiers.add(qualifier);
314
- if (qualifier === "CONSTANT") constant = true;
315
- }
316
- const members = this.members("END_VAR");
317
- this.accept(";");
318
- if (this.peek()) this.error("only one VAR_GLOBAL block per file is supported");
319
- return { name, description, source: this.source.name, constant, members };
320
- }
368
+ globals(name: string): GlobalList {
369
+ const description = this.documentation();
370
+ this.expect("VAR_GLOBAL");
371
+ const written = new Set<string>();
372
+ while (qualifiers.has(this.peek())) {
373
+ const qualifier = this.take().toUpperCase();
374
+ if (written.has(qualifier)) {
375
+ this.error(`duplicate ${qualifier} qualifier`);
376
+ }
377
+ written.add(qualifier);
378
+ }
379
+ const members = this.members("END_VAR");
380
+ this.accept(";");
381
+ if (this.peek()) {
382
+ this.error("only one VAR_GLOBAL block per file is supported");
383
+ }
384
+ return {
385
+ name,
386
+ description,
387
+ source: this.source.name,
388
+ constant: written.has("CONSTANT"),
389
+ members,
390
+ };
391
+ }
321
392
  }
322
393
 
323
394
  export function parseDeclarations(source: Source): Declaration[] {
324
- return new Parser(source).declarations();
395
+ return new Parser(source).declarations();
325
396
  }
326
397
 
327
398
  export function parseGlobals(source: Source, name: string): GlobalList {
328
- return new Parser(source).globals(name);
399
+ return new Parser(source).globals(name);
329
400
  }