-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Use DSL v2 types in place of ScannerDefinitionNode (#1003)
Based on #1002 Part of #638 The DSL v2's `model::Scanner` is almost 1:1 usable with our current parser codegen, with the exception of versioned scanners. In short we: - introduce a helper type `VersionedScanner` that is used in place of the old `ScannerDefinitionNode::Versioned` - introduce a `ScannerExt` trait implemented for both `VersionedScanner` and the `model::Scanner`, which is responsible for generating the main scanning logic - Repurposes `ScannerDefinition` slightly to surface more of the scanner-related logic for trivia/fragment/token - implements this directly for `model::{TriviaItem,FragmentItem,TokenItem}` and stores it in the v1 Grammar struct - similarly, uses `model::KeywordItem` directly in place of v1's `KeywordScannerDefinition` as they shared the same functionality
- Loading branch information
Showing
13 changed files
with
290 additions
and
402 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
Oops, something went wrong.