-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RFC007] Migrate the parser to the new AST (#2083)
* Switch to the new AST repr for parser - part I First stab at making the parser compatible with the new AST representation (`bytecode::ast::Ast`). This is a heavy refactoring which required to update most of `parser::uniterm` and `parser::utils` as well as `grammar.lalrpop`. The current version is far from compiling; fixing compiler errors is planned in follow-up work. * Fix almost all grammar errors, fix parser/mod.rs * Fix last errors to make it compile * Remove bytecode-experimental feature As we move toward a bytecode compiler and a bytecode virtual machine, we are replacing the left part of the pipeline with the new AST representation. The bytecode module was previously gated by an experimental feature, thea idea being that this feature would enable the whole bytcode compiler pipeline. However, for now, we only have a new AST representation, and it's being used in the mainline Nickel parser (and soon, in the typechecker, etc.). Thus we need access to the new AST representation by default, and it doesn't make much sense to gate it behind a feature. We'll reintroduce the feature once we have a prototype compiler and a bytecode virtual machine, when it will then make sense to use the feature to toggle between the legacy tree-walking interpreter and the new bytecode compiler. * Fix curried operator handling and make its impl nicer * Revert to the previous handling of last fields (might need conflict resolution for RepeatSep1) * Fix compilation errors and spurious grammar ambiguity * Fix unwrapping position panicking * Fill todo!() when parsing seal/unseal * Entirely get rid of rec priorities leftovers * Fix fix_type_vars for forall binders, improve code doc sporadically * Fix handling of zero-ary application/variable * Fix test code and corner case of new -> mainline conversion * [Maybe to drop?] Fix failing test (symbolic string being recursive records) * Fix swapped seal/unseal * Fix missing position for elaborated merge (piecewise defs) * Remove FieldDef and record elaboration from parser * Fix compilation error after rebase * Fix missing field name; dont use generated ident for op curryfication * Fix missing position panic, remove unused function * Add measures for AST conversion * Fix clippy and cargo doc warnings * Update core/src/parser/uniterm.rs Co-authored-by: jneem <[email protected]> --------- Co-authored-by: jneem <[email protected]>
- Loading branch information
Showing
31 changed files
with
1,976 additions
and
1,611 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.