-
Notifications
You must be signed in to change notification settings - Fork 74
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
Move error reporting and initialisation clean-up #135
Conversation
Facts left to add to polonius-parser:
There are probably also additionally renamings. I think we should abbreviate the names of dops, uses, and moves to just |
It should now be much clearer what is computed when, and why.
Closes #116. Also, fixes a compile error I forgot.
This removes a *lot* of duplicate code.
I have removed the WIP marker because I think this is is perhaps ready to merge now. |
The existing tests in |
Sorry but it's hard to tell from the GH interface: it seems most/all of the unused input facts are removed by this PR, but some are still referenced in the |
That's really weird! Or are they not run by |
Correct; that's an oversight I'll have to fix! |
As the tests are in a subcrate, its tests are run on demand with |
I…didn’t think about that. Thanks; I’ll look into it!
|
This removes a LOT of unused facts that we don't need for the unit tests, and renames and updates those we do need.
Also drive-by update: replace repeated assert `.is_ok()` followed by unwrap with more succinct `.expect()` to catch (and more importantly print) parser errors.
🚀 |
This PR mainly implements move error reporting. It also:
child
is transitive (i.e. actually maps some ancestor relation); children are now direct children, i.echild(Daughter, Mother)
but notchild(Daughter, Grandmother)
. This means it is now safe to simplify the generation code in Rust. This closes the Polonius part of child facts should only contain immediate children #120.polonius-parser
Left to do:
Writing at least some testsLet's just use compiletestDocument everything in the book (this would also address document init_var_maybe_initialized_on_exit #116, document how to run Polonius in Rust's unit tests in the book #119)Is now the independent Issue Import the rules from HackMD into the Polonius book #141As mentioned in one of the comments below,
polonius-parser
and the unit tests need a lot of work to function with this set of new facts. The current version ofpolonius-parser
is essentially a re-skin of the old version with the new fact names. It has no facilities for generating any of the new facts, which means that it cannot exercise any of the new logic. Additionally, there's an open and ongoing discussion about what precisely the model language used by the parser should look like, how much work it should do on its own, etc.