Skip to content

Commit

Permalink
Merge pull request #337 from FedericoPonzi/issue-293
Browse files Browse the repository at this point in the history
Don't generate .cfg file when transpiling pluscal
  • Loading branch information
FedericoPonzi committed Sep 27, 2024
2 parents cd0eaa8 + 9b37053 commit 2e5780c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/tla2tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const cmodsJarPath = path.resolve(__dirname, '../tools/' + TLA_CMODS_LIB_NAME);
const javaCmd = 'java' + (process.platform === 'win32' ? '.exe' : '');
const javaVersionChannel = new ToolOutputChannel('TLA+ Java version');
const TLA_TOOLS_STANDARD_MODULES = '/tla2sany/StandardModules';
const TLA_TOOLS_PLUSCAL_PARAM_SKIP_CFG_CREATION = "-nocfg";

Check warning on line 37 in src/tla2tools.ts

View workflow job for this annotation

GitHub Actions / build (macOS-latest)

Strings must use singlequote

Check warning on line 37 in src/tla2tools.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-20.04)

Strings must use singlequote

Check warning on line 37 in src/tla2tools.ts

View workflow job for this annotation

GitHub Actions / build (windows-latest)

Strings must use singlequote

let lastUsedJavaHome: string | undefined;
let cachedJavaPath: string | undefined;
Expand Down Expand Up @@ -243,6 +244,7 @@ export function buildTlcOptions(tlaFilePath: string, cfgFilePath: string, custom
*/
export function buildPlusCalOptions(tlaFilePath: string, customOptions: string[]): string[] {
const opts = customOptions.slice(0);
opts.push(TLA_TOOLS_PLUSCAL_PARAM_SKIP_CFG_CREATION);
opts.push(path.basename(tlaFilePath));
return opts;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/suite/tla2tools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ suite('TLA+ Tools Test Suite', () => {
test('Builds PlusCal options with no custom settings', () => {
assert.deepEqual(
buildPlusCalOptions('/path/to/module.tla', []),
['module.tla']
['-nocfg', 'module.tla']
);
});

test('Puts PlusCal custom options before module name', () => {
assert.deepEqual(
buildPlusCalOptions('/path/to/module.tla', ['-lineWidth', '100', '-nocfg']),
buildPlusCalOptions('/path/to/module.tla', ['-lineWidth', '100']),
['-lineWidth', '100', '-nocfg', 'module.tla']
);
});
Expand Down

0 comments on commit 2e5780c

Please sign in to comment.