Skip to content

Commit

Permalink
[1 changes] feat: LSP completion function detail (noir-lang/noir#5993)
Browse files Browse the repository at this point in the history
feat: add `TypedExpr::get_type` (noir-lang/noir#5992)
feat: better error message for misplaced doc comments (noir-lang/noir#5990)
fix: Error when comptime types are used in runtime code (noir-lang/noir#5987)
  • Loading branch information
AztecBot committed Sep 11, 2024
1 parent 05cc59f commit 534b8ca
Show file tree
Hide file tree
Showing 146 changed files with 3,985 additions and 2,062 deletions.
2 changes: 1 addition & 1 deletion .noir-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b84009ca428a5790acf53a6c027146b706170574
e84f7d2e81c1f59e9af015f38c2d477607a9c558
1 change: 0 additions & 1 deletion noir/noir-repo/.gitattributes

This file was deleted.

103 changes: 6 additions & 97 deletions noir/noir-repo/Cargo.lock

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

2 changes: 1 addition & 1 deletion noir/noir-repo/acvm-repo/acvm/tests/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1584,7 +1584,7 @@ proptest! {
#[test]
fn keccak256_injective(inputs_distinct_inputs in any_distinct_inputs(Some(8), 0, 32)) {
let (inputs, distinct_inputs) = inputs_distinct_inputs;
let (result, message) = prop_assert_injective(inputs, distinct_inputs, 32, Some(32), keccak256_op);
let (result, message) = prop_assert_injective(inputs, distinct_inputs, 32, Some(8), keccak256_op);
prop_assert!(result, "{}", message);
}

Expand Down
2 changes: 1 addition & 1 deletion noir/noir-repo/acvm-repo/acvm_js/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function run_if_available {
require_command jq
require_command cargo
require_command wasm-bindgen
#require_command wasm-opt
require_command wasm-opt

self_path=$(dirname "$(readlink -f "$0")")
pname=$(cargo read-manifest | jq -r '.name')
Expand Down
10 changes: 8 additions & 2 deletions noir/noir-repo/aztec_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ fn transform(

// Usage -> mut ast -> aztec_library::transform(&mut ast)
// Covers all functions in the ast
for submodule in ast.submodules.iter_mut().filter(|submodule| submodule.is_contract) {
for submodule in
ast.submodules.iter_mut().map(|m| &mut m.item).filter(|submodule| submodule.is_contract)
{
if transform_module(
&file_id,
&mut submodule.contents,
Expand Down Expand Up @@ -111,7 +113,8 @@ fn transform_module(
}

let has_initializer = module.functions.iter().any(|func| {
func.def
func.item
.def
.attributes
.secondary
.iter()
Expand All @@ -121,6 +124,7 @@ fn transform_module(
let mut stubs: Vec<_> = vec![];

for func in module.functions.iter_mut() {
let func = &mut func.item;
let mut is_private = false;
let mut is_public = false;
let mut is_initializer = false;
Expand Down Expand Up @@ -175,6 +179,7 @@ fn transform_module(
let private_functions: Vec<_> = module
.functions
.iter()
.map(|t| &t.item)
.filter(|func| {
func.def
.attributes
Expand All @@ -187,6 +192,7 @@ fn transform_module(
let public_functions: Vec<_> = module
.functions
.iter()
.map(|func| &func.item)
.filter(|func| {
func.def
.attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ fn generate_compute_note_hash_and_optionally_a_nullifier(
assert_eq!(errors.len(), 0, "Failed to parse Noir macro code. This is either a bug in the compiler or the Noir macro code");

let mut function_ast = function_ast.into_sorted();
function_ast.functions.remove(0)
function_ast.functions.remove(0).item
}

fn generate_compute_note_hash_and_optionally_a_nullifier_source(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use acvm::acir::AcirField;

use noirc_errors::Location;
use noirc_frontend::ast::{Ident, NoirFunction, UnresolvedTypeData};
use noirc_frontend::ast::{Documented, Ident, NoirFunction, UnresolvedTypeData};
use noirc_frontend::{
graph::CrateId,
macros_api::{FieldElement, FileId, HirContext, HirExpression, HirLiteral, HirStatement},
Expand Down Expand Up @@ -267,15 +267,16 @@ pub fn generate_contract_interface(
.methods
.iter()
.enumerate()
.map(|(i, (method, orig_span))| {
.map(|(i, (documented_method, orig_span))| {
let method = &documented_method.item;
if method.name() == "at" || method.name() == "interface" || method.name() == "storage" {
(method.clone(), *orig_span)
(documented_method.clone(), *orig_span)
} else {
let (_, new_location) = stubs[i];
let mut modified_method = method.clone();
modified_method.def.name =
Ident::new(modified_method.name().to_string(), new_location.span);
(modified_method, *orig_span)
(Documented::not_documented(modified_method), *orig_span)
}
})
.collect();
Expand Down
Loading

0 comments on commit 534b8ca

Please sign in to comment.