Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update tests and fix bugs in parser #64

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open

Conversation

NTTVy03
Copy link
Collaborator

@NTTVy03 NTTVy03 commented Dec 30, 2024

Update tests

  1. Update parser tests
  2. Add scope parsing tests
  3. Refactor syntax test
  4. Use snapshot testing

Fix

  1. Remove trivial tokens before template name and function name...
  2. Replace expect with eat in the block parser
  3. Change param type in find signal methods (template)
  4. Add error report in expect and expect_any

Add some other token kinds

  1. Add combined tokens (+=, *=, >>=,...)
  2. Re-priority tokens

Copy link
Owner

@vuvoth vuvoth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick review!

crates/parser/src/grammar/statement.rs Outdated Show resolved Hide resolved
crates/parser/src/grammar/block.rs Outdated Show resolved Hide resolved
use crate::token_kind::TokenKind;

#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Serialize)]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you add the Serialize trait?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need that trait for the snapshot testing (insta)

fn test(source: &str, snapshot_name: &str) {
        let input = Input::new(&source);

        insta::assert_yaml_snapshot!(snapshot_name, input);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants