-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Implemented execParser in the test tool utils, which is need in TestDollarParser. - TestDollarParser done. - Added helper string templates for parser generation in tests. - Updated the TypeScript string template in code gen (no underlines in template names). - Added support for `define` ("-D")in command line parsing. That field is now also searched through when looking for an option.
- Loading branch information
1 parent
79b5dc7
commit 4051542
Showing
18 changed files
with
810 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (c) Mike Lischke. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*/ | ||
|
||
import { describe, expect, it } from "vitest"; | ||
|
||
import { ToolTestUtils } from "./ToolTestUtils.js"; | ||
|
||
describe("TestDollarParser", () => { | ||
it("testSimpleCall", async () => { | ||
const orgLog = console.log; | ||
let output = ""; | ||
console.log = (str) => { | ||
output += str; | ||
}; | ||
|
||
try { | ||
const grammar = "grammar T;\n" + | ||
"a : ID { console.log($parser.getSourceName()); }\n" + | ||
" ;\n" + | ||
"ID : 'a'..'z'+ ;\n"; | ||
|
||
const errors = await ToolTestUtils.execParser("T.g4", grammar, "TParser", "TLexer", "a", "x", true); | ||
expect(output.includes("input")).toBe(true); | ||
expect(errors).toHaveLength(0); | ||
} finally { | ||
console.log = orgLog; | ||
} | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.