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

Start porting the Haskell test suite #33

Merged
merged 7 commits into from
Nov 21, 2017
Merged

Start porting the Haskell test suite #33

merged 7 commits into from
Nov 21, 2017

Conversation

birkenfeld
Copy link
Collaborator

This (based on the pretty branch) moves the test suite to its own crate, within a Cargo workspace.

The first test I ported is the largest one, which parses, pretty-prints and reparses several thousand files from the GCC test suite. (They are in a tarball in the repo which is unpacked by the new test.sh script.)

In the process, I fixed some outstanding bugs, so now all of those files are parseable and after pretty-printing, parsing that results in the same AST.

* Fixup formatting of lexer and parser error messages
* Implement Display of tokens properly
* Fix position tracking; errors now always point at the right token
  (or position where a token was expected)
* Implement std::error::Error
* Fixup octal literal printing (Rust uses 0o123)
* Use u128 type for C literals (to at least catch __int128)
  (Haskell uses its arbitrary-size type here, which is probably overkill)
* Fix parsing of hex/octal string escapes
* Traverse: apply a function to all nodes
  (using the Any trait to avoid having to write a whole visitor, or multiple functions)
* Equiv: check for AST equivalence
  (i.e. PartialEq, but ignore position info)
This is in preparation for later adding dynamic tests which
need to generate tests using a build script, which is better
in its own crate.
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.

1 participant