Skip to content

Commit ceedc37

Browse files
committed
Fix bug to collect conditions on record formats
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
1 parent 6951df7 commit ceedc37

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/ui/dspf.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,8 @@ export class DisplayFile {
163163
this.currentField.conditions.push(
164164
...DisplayFile.parseConditionals(conditionals)
165165
);
166-
167-
this.HandleKeywords(keywords, conditionals);
168166
}
167+
this.HandleKeywords(keywords, conditionals);
169168
}
170169
else {
171170
if (this.currentField) {
@@ -218,7 +217,8 @@ export class DisplayFile {
218217
insertIndex = this.currentField.keywordStrings.keywordLines.push(keywords);
219218
this.currentField.keywordStrings.conditionalLines[insertIndex] = conditionals;
220219
} else if (this.currentRecord) {
221-
this.currentRecord.keywordStrings.push(keywords);
220+
insertIndex = this.currentRecord.keywordStrings.keywordLines.push(keywords);
221+
this.currentRecord.keywordStrings.conditionalLines[insertIndex] = conditionals;
222222
}
223223

224224

@@ -246,7 +246,7 @@ export class DisplayFile {
246246
negate = (conditionColumns.substring(cIndex, cIndex + 1) === "N");
247247
indicator = Number(conditionColumns.substring(cIndex + 1, cIndex + 3));
248248

249-
conditionals.push(new Conditional(indicator, negate));
249+
conditionals.push({indicator, negate});
250250
}
251251

252252
cIndex += 3;
@@ -439,13 +439,13 @@ export class RecordInfo {
439439
public isWindow: boolean = false;
440440
public windowReference: string | undefined = undefined;
441441
public windowSize: { y: number, x: number, width: number, height: number } = { y: 0, x: 0, width: 80, height: 24 };
442-
public keywordStrings: string[] = [];
442+
public keywordStrings: { keywordLines: string[], conditionalLines: { [lineIndex: number]: string } } = { keywordLines: [], conditionalLines: {} };
443443
public keywords: Keyword[] = [];
444444

445445
constructor(public name: string) { }
446446

447447
handleKeywords() {
448-
const data = DisplayFile.parseKeywords(this.keywordStrings);
448+
const data = DisplayFile.parseKeywords(this.keywordStrings.keywordLines, this.keywordStrings.conditionalLines);
449449

450450
this.keywords.push(...data.keywords);
451451

@@ -532,6 +532,7 @@ export class FieldInfo {
532532
}
533533
}
534534

535-
export class Conditional {
536-
constructor(public indicator: number, public negate = false) { }
535+
export interface Conditional {
536+
indicator: number,
537+
negate: boolean
537538
}

0 commit comments

Comments
 (0)