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

feat: Format strings for prints #1952

Merged
merged 67 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
730c9ff
initial stdlib methods to start refactoring logign
vezenovm Jul 11, 2023
d75aedb
foreign call enum
vezenovm Jul 11, 2023
f28b915
Merge branch 'master' into mv/brillig_logs
vezenovm Jul 11, 2023
ce082b6
working println and println_format w/ brillig oracles
vezenovm Jul 12, 2023
4501b69
merge conflicts w/ master
vezenovm Jul 12, 2023
44ef833
fix up brillig_oracle test
vezenovm Jul 12, 2023
e9f6488
uncomment regression test for slice return from foreign calls in brillig
vezenovm Jul 12, 2023
e457faf
cargo clippy
vezenovm Jul 12, 2023
7cb1b10
got structs serialized correctly without aos_to_soa
vezenovm Jul 13, 2023
c7e4f0a
remove dbg
vezenovm Jul 13, 2023
1c64aff
working println_format
vezenovm Jul 13, 2023
e3d8931
merge conflicts w/ master
vezenovm Jul 13, 2023
5c24bf7
cargo clippy
vezenovm Jul 13, 2023
f4b17d4
rename enable_slices to experimental_ssa
vezenovm Jul 13, 2023
d2065ea
remove dbg and fix format_field_string
vezenovm Jul 13, 2023
b1739c0
initial work towards FmtStr literal
vezenovm Jul 14, 2023
613c94b
working format strins with one unified println method, still have som…
vezenovm Jul 17, 2023
2d459a7
remove old comment
vezenovm Jul 18, 2023
8b5c523
moved resolution of string to fmt string only when passing literals t…
vezenovm Jul 18, 2023
fd59219
delete temp intrinsic for println new
vezenovm Jul 18, 2023
9a7519b
remove unnecessary subtype
vezenovm Jul 18, 2023
ff1d406
remove debugging code w/ def id as part of mono pass Ident
vezenovm Jul 18, 2023
4a2c098
cleanup formatting stuff
vezenovm Jul 18, 2023
3623283
master conflicts
vezenovm Jul 18, 2023
5b27b77
merge conflcits w/ mv/brillig_logs after master merge
vezenovm Jul 18, 2023
ff34dd0
cargo clippy
vezenovm Jul 18, 2023
2288149
resolver test for fmt string
vezenovm Jul 18, 2023
a0df28c
remove TODO comment
vezenovm Jul 18, 2023
6c70d1f
cargo clippy
vezenovm Jul 18, 2023
5e6d0d5
pr comments
vezenovm Jul 19, 2023
77c771c
merge conflicts w/ master after brillig println merge
vezenovm Jul 24, 2023
2ebd23a
Merge branch 'master' into mv/format-string
vezenovm Jul 24, 2023
f19b1d4
expose full fmtstr type to the user
vezenovm Jul 24, 2023
4615225
add back fmt string resolver test
vezenovm Jul 24, 2023
0adca79
don't allow comparison of format strings
vezenovm Jul 24, 2023
0572d74
use JsonType Display trait
vezenovm Jul 24, 2023
bba1ed0
add issue for printing func params
vezenovm Jul 24, 2023
1cd2881
remove Token::F variant
vezenovm Jul 24, 2023
f953f29
remove old append_abi_arg func
vezenovm Jul 24, 2023
46240be
add comments to append_abi-arg
vezenovm Jul 24, 2023
692f85e
fix: format printing function parameters, store exprs rather than ide…
vezenovm Jul 24, 2023
741ef8b
remove ve old comment about not being able to use witness values in f…
vezenovm Jul 25, 2023
009279e
push fix for asfs{x}{x} case and more specific regex for idents
vezenovm Jul 25, 2023
643fca5
Update crates/noirc_evaluator/src/ssa_refactor/ssa_gen/mod.rs
vezenovm Jul 25, 2023
fa35f1b
remove is_match check
vezenovm Jul 25, 2023
c783a3b
breakout literal fmt str case in resolver to its own func
vezenovm Jul 25, 2023
515ef1e
update resolve_fmt_strings test
vezenovm Jul 25, 2023
a701fb8
switch to_owned placement in resolve_fmt_str_literal
vezenovm Jul 25, 2023
3dc2c83
Update crates/noirc_frontend/src/ast/mod.rs
vezenovm Jul 25, 2023
a7fa482
fix find_numeric_generics_in_type
vezenovm Jul 25, 2023
9971fac
add case of fmt string in if statement
vezenovm Jul 25, 2023
a97f251
add contains_numeric_typevar cases for string and fmtstring
vezenovm Jul 25, 2023
927abfe
add unify and subtype checks and fix resolver fmt string test
vezenovm Jul 25, 2023
b30c543
merge conflicts w/ master and cargo fmt
vezenovm Jul 31, 2023
5c2fddd
working generic fmtstr types
vezenovm Jul 31, 2023
02ed2b8
separate fmtstr codegen into variables
vezenovm Aug 1, 2023
0556ca3
Update crates/noirc_frontend/src/parser/parser.rs
jfecher Aug 1, 2023
9c84e21
Update crates/noirc_abi/src/input_parser/json.rs
vezenovm Aug 1, 2023
9d320f7
Update crates/noirc_frontend/src/ast/mod.rs
vezenovm Aug 1, 2023
8a5825f
Update crates/noirc_frontend/src/monomorphization/mod.rs
vezenovm Aug 1, 2023
618d376
Update crates/noirc_frontend/src/monomorphization/mod.rs
vezenovm Aug 1, 2023
a940145
Update crates/noirc_frontend/src/monomorphization/mod.rs
vezenovm Aug 1, 2023
34f1d58
Update crates/noirc_frontend/src/parser/parser.rs
vezenovm Aug 1, 2023
4f9bac7
keep the size of fmtrstr type as mandatory
vezenovm Aug 1, 2023
c2e6ef7
print original fmt string in monomorphization printer
vezenovm Aug 1, 2023
5819d10
print literal update for fmtstr
vezenovm Aug 1, 2023
9c95414
add parens to f-string literal printer
vezenovm Aug 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 54 additions & 62 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ noirc_errors = { path = "crates/noirc_errors" }
noirc_evaluator = { path = "crates/noirc_evaluator" }
noirc_frontend = { path = "crates/noirc_frontend" }
noir_wasm = { path = "crates/wasm" }

cfg-if = "1.0.0"
clap = { version = "4.1.4", features = ["derive"] }
codespan = {version = "0.11.1", features = ["serialization"]}
Expand All @@ -57,4 +56,4 @@ wasm-bindgen = { version = "=0.2.86", features = ["serde-serialize"] }
wasm-bindgen-test = "0.3.33"

[patch.crates-io]
async-lsp = { git = "https://github.com/oxalica/async-lsp", rev = "09dbcc11046f7a188a80137f8d36484d86c78c78" }
async-lsp = { git = "https://github.com/oxalica/async-lsp", rev = "09dbcc11046f7a188a80137f8d36484d86c78c78" }
2 changes: 2 additions & 0 deletions crates/nargo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ noirc_driver.workspace = true
iter-extended.workspace = true
toml.workspace = true
serde.workspace = true
serde_json.workspace = true
thiserror.workspace = true
noirc_errors.workspace = true
regex = "1.9.1"
18 changes: 18 additions & 0 deletions crates/nargo/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use acvm::pwg::OpcodeResolutionError;
use noirc_abi::errors::{AbiError, InputParserError};
use thiserror::Error;

#[derive(Debug, Error)]
Expand All @@ -10,4 +11,21 @@ pub enum NargoError {
/// ACIR circuit solving error
#[error(transparent)]
SolvingError(#[from] OpcodeResolutionError),

#[error(transparent)]
ForeignCallError(#[from] ForeignCallError),
}

#[derive(Debug, Error)]
pub enum ForeignCallError {
#[error("Foreign call inputs needed for execution are missing")]
MissingForeignCallInputs,

/// ABI encoding/decoding error
#[error(transparent)]
AbiError(#[from] AbiError),

/// Input parsing error
#[error(transparent)]
InputParserError(#[from] InputParserError),
}
Loading