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

[BUG] Syntax Errors in Core files in internal functions causes weird error messages #65

Open
Pillber opened this issue Apr 5, 2024 · 0 comments

Comments

@Pillber
Copy link
Contributor

Pillber commented Apr 5, 2024

Describe the bug
If making an internal trait in the core standard library, (say string.rv) and any keywords are misspelled, the parser panics and also displays an incorrect parsing error message.

Raven Code To Reproduce
in string.rv:

internal impl Add<char, str> for char {
    pub fun add(self, other: str) -> str {
    //   ^ wrong token
    }
}

Error Output or Unexpected Behavior
when running cargo test --bin magpie -- --nocapture:

running 1 test
Running arrays::test
thread 'io-runtime' panicked at language\parser\src\parser\struct_parser.rs:204:18:
How'd you get here? string - FieldName (2, lic fn add(self, other)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Errors:
Failed to find type strcmp, did you import it correctly?
in file string.rv:16:21
   |
16 |         return strcmp(self, other) == 0;
   |                      ^
thread 'test::test::test_magpie' panicked at tools\magpie\src\test.rs:52:32:
Failed to compile test arrays::test!
test test::test::test_magpie ... FAILED

failures:

failures:
    test::test::test_magpie

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s

error: test failed, to rerun pass `-p magpie --bin magpie`

Additional context
This may or may not happen in other places, but this place is for sure.

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

No branches or pull requests

1 participant