-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Format strings for prints (#1952)
* initial stdlib methods to start refactoring logign * foreign call enum * working println and println_format w/ brillig oracles * fix up brillig_oracle test * uncomment regression test for slice return from foreign calls in brillig * cargo clippy * got structs serialized correctly without aos_to_soa * remove dbg * working println_format * cargo clippy * rename enable_slices to experimental_ssa * remove dbg and fix format_field_string * initial work towards FmtStr literal * working format strins with one unified println method, still have some cleanup to-do, use Display/Debug for pretty printing * remove old comment * moved resolution of string to fmt string only when passing literals to functions * delete temp intrinsic for println new * remove unnecessary subtype * remove debugging code w/ def id as part of mono pass Ident * cleanup formatting stuff * cargo clippy * resolver test for fmt string * remove TODO comment * cargo clippy * pr comments * expose full fmtstr type to the user * add back fmt string resolver test * don't allow comparison of format strings * use JsonType Display trait * add issue for printing func params * remove Token::F variant * remove old append_abi_arg func * add comments to append_abi-arg * fix: format printing function parameters, store exprs rather than idents as part of HirLiteral::FmtStr * remove ve old comment about not being able to use witness values in fmt strings * push fix for asfs{x}{x} case and more specific regex for idents * Update crates/noirc_evaluator/src/ssa_refactor/ssa_gen/mod.rs Co-authored-by: jfecher <jake@aztecprotocol.com> * remove is_match check * breakout literal fmt str case in resolver to its own func * update resolve_fmt_strings test * switch to_owned placement in resolve_fmt_str_literal * Update crates/noirc_frontend/src/ast/mod.rs Co-authored-by: jfecher <jake@aztecprotocol.com> * fix find_numeric_generics_in_type * add case of fmt string in if statement * add contains_numeric_typevar cases for string and fmtstring * add unify and subtype checks and fix resolver fmt string test * working generic fmtstr types * separate fmtstr codegen into variables * Update crates/noirc_frontend/src/parser/parser.rs * Update crates/noirc_abi/src/input_parser/json.rs Co-authored-by: jfecher <jake@aztecprotocol.com> * Update crates/noirc_frontend/src/ast/mod.rs Co-authored-by: jfecher <jake@aztecprotocol.com> * Update crates/noirc_frontend/src/monomorphization/mod.rs Co-authored-by: jfecher <jake@aztecprotocol.com> * Update crates/noirc_frontend/src/monomorphization/mod.rs Co-authored-by: jfecher <jake@aztecprotocol.com> * Update crates/noirc_frontend/src/monomorphization/mod.rs Co-authored-by: jfecher <jake@aztecprotocol.com> * Update crates/noirc_frontend/src/parser/parser.rs Co-authored-by: jfecher <jake@aztecprotocol.com> * keep the size of fmtrstr type as mandatory * print original fmt string in monomorphization printer * print literal update for fmtstr * add parens to f-string literal printer --------- Co-authored-by: jfecher <jake@aztecprotocol.com>
- Loading branch information
Showing
21 changed files
with
414 additions
and
42 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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.