Skip to content

Conversation

@dsimunic
Copy link

@dsimunic dsimunic commented Dec 3, 2025

Resolved all real failures in the test. A few real failures were linked to multiline string parsing: after replacing the regex with a new token in the scanner, all parses are correct.

While at it, also resolved the bug with nesting block comments. Closes #78

About 50 files were elm 0.18 or syntax errors. Checked each one individually on Elm 0.19 compiler. Blacklisted those files in expected_fails.txt. The existing parse-examples-full will probably report 51 error since it doesn't know about the blacklist.

Finally, I cleaned up the test corpus: instead of downloading each repo and risking that something changes, I moved all .elm files and licenses into a clean repo. This gives us a stable test inputs. I've added a new script parse-test-corpus that works on that corpus, and the corresponding workflow action test-on-test-corpus.yml.

$ script/parse-test-corpus --expect-fail script/expected_fails.txt  /Volumes/Devel/var/tree-sitter-elm/tree-sitter-elm-test-corpus
Parsing...
-----------------------------------------------------------------
No unexpected failures!

All expected failures failed as expected.

Summary:
  Total files parsed: 20119
  Successful parses: 20119
  Unexpected failures: 0
  Unexpected successes: 0
  Total errors: 0
  Success rate: 100.00%
-----------------------------------------------------------------

Took: 17.253 seconds

If you agree with that new workflow, it obsoletes a bunch of test scripts that I can delete in another PR.

The test files are presently in my GitHub account, but I'd like to move that repo over to elm-tooling if you're ok with that.

@dsimunic
Copy link
Author

dsimunic commented Dec 3, 2025

For whatever reason, the env var didn't pick up the default. For the new testing to pass we need to fix the path to the test corpus repo in repo vars.

CORPUS_PATH: ${{ vars.TEST_CORPUS_PATH || 'https://github.com/dsimunic/tree-sitter-elm-test-corpus' }}

Alternatively I can hard-code the path and then we fix it in another PR if you agree to move the data over to elm-tooling.

@dsimunic
Copy link
Author

dsimunic commented Dec 9, 2025

Hey! Is there anything else you expect from me on this one?

@dsimunic dsimunic mentioned this pull request Dec 9, 2025
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.

Make block comments nestable

1 participant