Skip to content

Commit 95c6564

Browse files
committed
Add missing indicators to default cache
Signed-off-by: worksofliam <[email protected]>
1 parent c061f60 commit 95c6564

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

language/models/cache.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,19 @@ import { CacheProps, IncludeStatement, Keywords } from "../parserTypes";
22
import { IRange } from "../types";
33
import Declaration from "./declaration";
44

5+
const DEFAULT_INDICATORS = [
6+
...Array(98).keys(),
7+
`LR`, `KL`, `MR`,
8+
`L1`, `L2`, `L3`, `L4`, `L5`, `L6`, `L7`, `L8`, `L9`,
9+
`U1`, `U2`, `U3`, `U4`, `U5`, `U6`, `U7`, `U8`,
10+
`OA`, `OB`, `OC`, `OD`, `OE`, `OF`, `OG`, `OV`,
11+
`KA`, `KB`, `KC`, `KD`, `KE`, `KF`, `KG`, `KH`, `KI`, `KJ`, `KK`, `KL`, `KM`, `KN`,
12+
`KP`, `KQ`, `KR`, `KS`, `KT`, `KU`, `KV`, `KW`, `KX`, `KY`,
13+
`H1`, `H2`, `H3`, `H4`, `H5`, `H6`, `H7`, `H8`, `H9`
14+
];
15+
516
const newInds = () => {
6-
return [...Array(98).keys(), `LR`, `KL`].map(val => `IN${val.toString().padStart(2, `0`)}`).map(ind => {
17+
return DEFAULT_INDICATORS.map(val => `IN${val.toString().padStart(2, `0`)}`).map(ind => {
718
const indDef = new Declaration(`variable`);
819
indDef.name = ind;
920
indDef.keyword = { IND: true };

language/models/fixed.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export function parseFLine(lineNumber, lineIndex, content) {
6464
*/
6565
export function parseCLine(lineNumber, lineIndex, content) {
6666
content = content.padEnd(80);
67+
const clIndicator = content.substr(7, 8).toUpperCase();
6768
const indicator = content.substr(9, 11);
6869
const factor1 = content.substr(11, 14);
6970
const opcode = content.substr(25, 10).toUpperCase();
@@ -79,6 +80,7 @@ export function parseCLine(lineNumber, lineIndex, content) {
7980
const ind3 = content.substr(74, 2);
8081

8182
return {
83+
clIndicator: calculateToken(lineNumber, lineIndex+7, clIndicator, `special-ind`),
8284
indicator: calculateToken(lineNumber, lineIndex+9, indicator, `special-ind`),
8385
opcode: calculateToken(lineNumber, lineIndex+25, opcode, `opcode`),
8486
factor1: calculateToken(lineNumber, lineIndex+11, factor1),

language/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,7 @@ export default class Parser {
13821382
case `C`:
13831383
const cSpec = parseCLine(lineNumber, lineIndex, line);
13841384

1385-
tokens = [cSpec.indicator, cSpec.ind1, cSpec.ind2, cSpec.ind3];
1385+
tokens = [cSpec.clIndicator, cSpec.indicator, cSpec.ind1, cSpec.ind2, cSpec.ind3];
13861386

13871387
const fromToken = (token?: Token) => {
13881388
return token ? Parser.lineTokens(token.value, lineNumber, token.range.start) : [];

0 commit comments

Comments
 (0)