From 4c910c858e24b5247bd569041b395aa0fd9970f1 Mon Sep 17 00:00:00 2001 From: rrgoetz Date: Tue, 14 Jan 2025 12:03:59 -1000 Subject: [PATCH] Fix @MODEL generation. There shouldn't be any parenthesis and commas in the SeqN generation --- .../codemirror/satf/satf-sasf-utils.test.ts | 12 ++++++------ src/utilities/codemirror/satf/satf-sasf-utils.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/utilities/codemirror/satf/satf-sasf-utils.test.ts b/src/utilities/codemirror/satf/satf-sasf-utils.test.ts index 93a1f3cf5e..02da771e8d 100644 --- a/src/utilities/codemirror/satf/satf-sasf-utils.test.ts +++ b/src/utilities/codemirror/satf/satf-sasf-utils.test.ts @@ -91,9 +91,9 @@ describe('satfToSequence', () => { expect(result.sequences[0].name).toStrictEqual('test'); expect(result.sequences[0].sequence).toStrictEqual(`## test R00:01:00 01VV param6 10 false "abc" # This command turns, to correct position. -@MODEL(x,1,"00:00:00") -@MODEL(z,1.1,"00:00:00") -@MODEL(y,"abc","00:00:00")`); +@MODEL "x" 1 "00:00:00" +@MODEL "z" 1.1 "00:00:00" +@MODEL "y" "abc" "00:00:00"`); }); it('should return multiple sequence with models', async () => { @@ -127,9 +127,9 @@ R00:01:00 01VV param6 10 false "abc" # This command turns, to correct position. expect(result.sequences[0].name).toStrictEqual('test'); expect(result.sequences[0].sequence).toStrictEqual(`## test R00:01:00 01VV param6 10 false "abc" # This command turns, to correct position. -@MODEL(x,1,"00:00:00") -@MODEL(z,1.1,"00:00:00") -@MODEL(y,"abc","00:00:00")`); +@MODEL "x" 1 "00:00:00" +@MODEL "z" 1.1 "00:00:00" +@MODEL "y" "abc" "00:00:00"`); }); }); diff --git a/src/utilities/codemirror/satf/satf-sasf-utils.ts b/src/utilities/codemirror/satf/satf-sasf-utils.ts index 6018d8ebec..582e2c50ad 100644 --- a/src/utilities/codemirror/satf/satf-sasf-utils.ts +++ b/src/utilities/codemirror/satf/satf-sasf-utils.ts @@ -881,7 +881,7 @@ function parseModel(modelNode: SyntaxNode | null, text: string): string { if (!keyNode || !valueNode) { return null; } - return `@MODEL(${text.slice(keyNode.from, keyNode.to)},${text.slice(valueNode.from, valueNode.to)},"00:00:00")`; + return `@MODEL "${text.slice(keyNode.from, keyNode.to)}" ${text.slice(valueNode.from, valueNode.to)} "00:00:00"`; }) .filter(model => model !== null) .join('\n');