-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor the Parser to allow implementing a simple LexerLess parser
by using method overrides. A more proper solution with depedency injection proved too damaging to performance... Part of #521 Fixes #528
- Loading branch information
Showing
4 changed files
with
122 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,28 @@ | ||
import { parse } from "./ecma_quirks" | ||
|
||
describe("ECMAScript Quirks Example (ScannerLess Mode)", () => { | ||
describe.only("ECMAScript Quirks Example (ScannerLess Mode)", () => { | ||
it("can parse a valid text successfully", () => { | ||
const result = parse("return ;") | ||
expect(result.errors).to.be.empty | ||
}) | ||
|
||
it("can parse a valid text successfully #2", () => { | ||
const result = parse("return 1;") | ||
expect(result.errors).to.be.empty | ||
}) | ||
|
||
it("can parse a valid text successfully #3 - Division", () => { | ||
const result = parse("return 8 / 2 ;") | ||
expect(result.errors).to.be.empty | ||
}) | ||
|
||
it("can parse a valid text successfully #3 - RegExp", () => { | ||
const result = parse("return /123/ ;") | ||
expect(result.errors).to.be.empty | ||
}) | ||
|
||
it("can parse a valid text successfully #3 - RegExp and Division", () => { | ||
const result = parse("return /123/ / 5 ;") | ||
expect(result.errors).to.be.empty | ||
}) | ||
}) |