diff --git a/book/src/rfc/rfc-0-generic-parameters.md b/book/src/rfc/rfc-0-generic-parameters.md index 59baef26a..196bf18f7 100644 --- a/book/src/rfc/rfc-0-generic-parameters.md +++ b/book/src/rfc/rfc-0-generic-parameters.md @@ -94,7 +94,7 @@ The current pipeline of compiling noname code is: 1. Parse the code into AST 2. Convert the AST into NAST with naming resolution 3. Convert the NAST into TAST with type metadata collection and type checking -4. Circuit synthesizing TAST into an constraint system +4. Circuit synthesizing TAST into a constraint system With generic parameters, the current TAST phase can't handle the type checking anymore, because the generic parameters are unknown. For example, it can't type check the array with symbolic size without resolving the values for the generic parameters. @@ -438,7 +438,7 @@ Circuit synthesizer will rely on the monomorphized AST to compile the circuit. T ## Alternative approach [One alternative approach](https://github.com/zksecurity/noname/pull/136) to the monomorphization described above is to propagate the generic values directly in circuit writer, without the need to add the MAST phase. -The circuit writer walks through the original AST via the `compile_expr` function. This function propagate the values from the main function argument and constants and compute the `VarOrRef` as an result. The `VarOrRef` doesn't return the structure of the types being computed. +The circuit writer walks through the original AST via the `compile_expr` function. This function propagate the values from the main function argument and constants and compute the `VarOrRef` as a result. The `VarOrRef` doesn't return the structure of the types being computed. In the process, when it needs to determine the structure of the type behind an expression node, it relies on the `size_of` function to determine the number of vars representing the type. The `size_of` relies on the node id of an expression to look up the type. This is not a problem when the types are concrete. diff --git a/src/mast/mod.rs b/src/mast/mod.rs index 4e7120840..aad2c1ece 100644 --- a/src/mast/mod.rs +++ b/src/mast/mod.rs @@ -1002,7 +1002,7 @@ fn monomorphize_expr( _ => Err(Error::new( "Container Access", ErrorKind::UnexpectedError( - "Attempting to access container when type is not an container", + "Attempting to access container when type is not a container", ), expr.span, ))?, diff --git a/src/syntax.rs b/src/syntax.rs index f8db305b8..01f761683 100644 --- a/src/syntax.rs +++ b/src/syntax.rs @@ -5,7 +5,7 @@ pub fn is_numeric(s: &str) -> bool { s.chars().all(|c| c.is_ascii_digit()) } -/// Returns true if the given string is an hexadecimal string (0x...) +/// Returns true if the given string is a hexadecimal string (0x...) pub fn is_hexadecimal(s: &str) -> bool { let mut s = s.chars(); let s0 = s.next();