-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update tests and fix bugs in parser (#64)
* skip trivial first tokens in parsing * remove comment in input test * manage out-of-bound case, update input test * update input test * update input test * make test programs private * remove comments in syntax tests * format * make Pragma optional, remove ROOT * rename close() params, use advance() in eat(), fix typo scope * parse params using list_identity * return Option in token_value() and position_of() * do not allow <--, <== in var declaration * make public signal optional in main component * fix format before merge * remove empty test * replace expect by eat in block * add scope parsing test * fix space in scope parsing test * update snapshot test for syntax * refactor syntax test * update input tests with snapshot * change param type in find signal into str * add snapshot guild * add some combine arithmetic operators * error report in expect and expect_any * update snapshot for combine operators * update snapshot test * fix wrap trivial tokens before open a tree * update template happy test * add operators into token kinds * add operators test * re-priority token kinds * fix clippy check * fix clippy check * rebase add-token-kinds * fix clippy check * fix clippy * remove duplicate declaration in grammar tests * remove duplicate else in comment * replace eat by expect for curly in block
- Loading branch information
Showing
30 changed files
with
1,614 additions
and
835 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ node_modules | |
.vscode-test | ||
/target | ||
Cargo.lock | ||
assets | ||
assets | ||
*.new | ||
*.pending-snap |
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,11 @@ | ||
# Snapshot Test | ||
|
||
* Run all tests: | ||
``` | ||
cargo test | ||
``` | ||
* Review snapshot changes | ||
``` | ||
cargo insta review | ||
``` |
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,9 @@ | ||
use crate::token_kind::TokenKind; | ||
|
||
#[derive(Debug, Clone, Copy)] | ||
#[derive(Debug, Clone)] | ||
pub enum Event { | ||
Open { kind: TokenKind }, | ||
Close, | ||
TokenPosition(usize), | ||
ErrorReport(String), | ||
} |
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
Oops, something went wrong.