Skip to content

Commit

Permalink
Fix @model generation.
Browse files Browse the repository at this point in the history
There shouldn't be any parenthesis and commas in the SeqN generation
  • Loading branch information
goetzrrGit committed Jan 15, 2025
1 parent 3bcb544 commit 98330e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/utilities/codemirror/satf/satf-sasf-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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"`);
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/utilities/codemirror/satf/satf-sasf-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 98330e2

Please sign in to comment.