remove option types in rest of places, clean up canonicalization

This commit is contained in:
gluax 2022-03-08 12:58:32 -08:00
parent 432ef73424
commit 86000325bf
35 changed files with 156 additions and 116 deletions

View File

@ -18,6 +18,8 @@
//! such that it applies changes to the AST nodes for canonicalization.
//! An example of these changes are transforming Self -> to the circuit name.
use std::cell::RefCell;
use leo_ast::*;
use leo_errors::{AstError, Result};
use leo_span::{sym, Span, Symbol};
@ -104,23 +106,14 @@ impl Canonicalizer {
}
}
fn canonicalize_self_type(&self, type_option: Option<&Type>) -> Option<Type> {
match type_option {
Some(type_) => match type_ {
Type::SelfType => Some(Type::Identifier(self.circuit_name.as_ref().unwrap().clone())),
Type::Array(type_, dimensions) => Some(Type::Array(
Box::new(self.canonicalize_self_type(Some(type_)).unwrap()),
dimensions.clone(),
)),
Type::Tuple(types) => Some(Type::Tuple(
types
.iter()
.map(|type_| self.canonicalize_self_type(Some(type_)).unwrap())
.collect(),
)),
_ => Some(type_.clone()),
},
None => None,
fn canonicalize_self_type(&self, type_: &Type) -> Type {
match type_ {
Type::SelfType => Type::Identifier(self.circuit_name.as_ref().unwrap().clone()),
Type::Array(type_, dimensions) => {
Type::Array(Box::new(self.canonicalize_self_type(type_)), dimensions.clone())
}
Type::Tuple(types) => Type::Tuple(types.iter().map(|type_| self.canonicalize_self_type(type_)).collect()),
_ => type_.clone(),
}
}
@ -174,7 +167,7 @@ impl Canonicalizer {
Expression::Cast(cast) => {
let inner = Box::new(self.canonicalize_expression(&cast.inner));
let target_type = self.canonicalize_self_type(Some(&cast.target_type)).unwrap();
let target_type = self.canonicalize_self_type(&cast.target_type);
return Expression::Cast(CastExpression {
inner,
@ -231,7 +224,7 @@ impl Canonicalizer {
AccessExpression::Static(static_access) => AccessExpression::Static(StaticAccess {
inner: Box::new(self.canonicalize_expression(&static_access.inner)),
name: static_access.name.clone(),
type_: self.canonicalize_self_type(static_access.type_.as_ref()),
type_: RefCell::new(self.canonicalize_self_type(&static_access.type_.borrow())),
span: static_access.span.clone(),
}),
};
@ -371,7 +364,7 @@ impl Canonicalizer {
}
Statement::Definition(definition) => {
let value = self.canonicalize_expression(&definition.value);
let type_ = self.canonicalize_self_type(Some(&definition.type_)).unwrap();
let type_ = self.canonicalize_self_type(&definition.type_);
Statement::Definition(DefinitionStatement {
declaration_type: definition.declaration_type.clone(),
@ -409,7 +402,7 @@ impl Canonicalizer {
})
}
Statement::Iteration(iteration) => {
let type_ = self.canonicalize_self_type(Some(&iteration.type_)).unwrap();
let type_ = self.canonicalize_self_type(&iteration.type_);
let start = self.canonicalize_expression(&iteration.start);
let stop = self.canonicalize_expression(&iteration.stop);
let block = self.canonicalize_block(&iteration.block);
@ -465,7 +458,7 @@ impl Canonicalizer {
fn canonicalize_function_input(&mut self, input: &FunctionInput) -> FunctionInput {
if let FunctionInput::Variable(variable) = input {
let type_ = self.canonicalize_self_type(Some(&variable.type_)).unwrap();
let type_ = self.canonicalize_self_type(&variable.type_);
return FunctionInput::Variable(FunctionInputVariable {
identifier: variable.identifier.clone(),
@ -495,7 +488,7 @@ impl Canonicalizer {
.iter()
.map(|input| self.canonicalize_function_input(input))
.collect();
let output = self.canonicalize_self_type(function.output.as_ref());
let output = self.canonicalize_self_type(&function.output);
let block = self.canonicalize_block(&function.block);
return CircuitMember::CircuitFunction(Box::new(Function {
@ -687,20 +680,15 @@ impl ReconstructingReducer for Canonicalizer {
annotations: IndexMap<Symbol, Annotation>,
input: Vec<FunctionInput>,
const_: bool,
output: Option<Type>,
output: Type,
block: Block,
) -> Result<Function> {
let new_output = match output {
None => Some(Type::Tuple(vec![])),
_ => output,
};
Ok(Function {
identifier,
annotations,
input,
const_,
output: new_output,
output,
block,
core_mapping: function.core_mapping.clone(),
span: function.span.clone(),

View File

@ -19,7 +19,7 @@ use crate::{Expression, Identifier, Node, Type};
use leo_span::Span;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::{cell::RefCell, fmt};
/// An access expression to a static member, e.g., a constant in a circuit.
/// An example would be `Foo::Const` or `Foo::function` in `Foo::function()`.
@ -30,9 +30,9 @@ pub struct StaticAccess {
pub inner: Box<Expression>,
/// The static member in `inner` that is being accessed.
pub name: Identifier,
/// An optional type initially None, it is later assigned during type inference snapshot if necessary.
/// A refcell type initially (), it is later assigned during type checking if necessary.
// FIXME(Centril): Shouldn't be in an AST. Remove it as part of an architectural revamp.
pub type_: Option<Type>,
pub type_: RefCell<Type>,
/// The span for the entire expression `inner::name`.
pub span: Span,
}

View File

@ -34,7 +34,7 @@ pub struct Function {
/// The function returns a constant value.
pub const_: bool,
/// The function return type, if explicitly specified, or `()` if not.
pub output: Option<Type>,
pub output: Type,
/// Any mapping to the core library.
/// Always `None` when initially parsed.
pub core_mapping: Cell<Option<Symbol>>,
@ -93,12 +93,8 @@ impl Function {
write!(f, "function {}", self.identifier)?;
let parameters = self.input.iter().map(|x| x.to_string()).collect::<Vec<_>>().join(",");
let returns = self.output.as_ref().map(|type_| type_.to_string());
if returns.is_none() {
write!(f, "({}) {}", parameters, self.block)
} else {
write!(f, "({}) -> {} {}", parameters, returns.unwrap(), self.block)
}
let returns = self.output.to_string();
write!(f, "({}) -> {} {}", parameters, returns, self.block)
}
}

View File

@ -182,11 +182,7 @@ impl<R: ReconstructingReducer> ReconstructingDirector<R> {
pub fn reduce_static_access(&mut self, static_access: &StaticAccess) -> Result<StaticAccess> {
let value = self.reduce_expression(&static_access.inner)?;
let name = self.reduce_identifier(&static_access.name)?;
let type_ = static_access
.type_
.as_ref()
.map(|type_| self.reduce_type(type_, &static_access.span))
.transpose()?;
let type_ = self.reduce_type(&static_access.type_.borrow(), &static_access.span)?;
self.reducer.reduce_static_access(static_access, value, type_, name)
}
@ -578,11 +574,7 @@ impl<R: ReconstructingReducer> ReconstructingDirector<R> {
inputs.push(self.reduce_function_input(input)?);
}
let output = function
.output
.as_ref()
.map(|type_| self.reduce_type(type_, &function.span))
.transpose()?;
let output = self.reduce_type(&function.output, &function.span)?;
let block = self.reduce_block(&function.block)?;

View File

@ -18,6 +18,8 @@
//! It implements default methods for each node to be made
//! given the information of the old node.
use std::cell::RefCell;
use crate::*;
use leo_errors::Result;
@ -176,13 +178,13 @@ pub trait ReconstructingReducer {
&mut self,
static_access: &StaticAccess,
value: Expression,
type_: Option<Type>,
type_: Type,
name: Identifier,
) -> Result<StaticAccess> {
Ok(StaticAccess {
inner: Box::new(value),
name,
type_,
type_: RefCell::new(type_),
span: static_access.span.clone(),
})
}
@ -472,7 +474,7 @@ pub trait ReconstructingReducer {
annotations: IndexMap<Symbol, Annotation>,
input: Vec<FunctionInput>,
const_: bool,
output: Option<Type>,
output: Type,
block: Block,
) -> Result<Function> {
Ok(Function {

View File

@ -14,6 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
use std::cell::RefCell;
use super::*;
use leo_errors::{ParserError, Result};
@ -375,7 +377,7 @@ impl ParserContext<'_> {
expr = Expression::Access(AccessExpression::Static(StaticAccess {
span: expr.span() + &ident.span,
inner: Box::new(expr),
type_: None,
type_: RefCell::new(Type::Tuple(Vec::new())),
name: ident,
}));
}

View File

@ -442,9 +442,9 @@ impl ParserContext<'_> {
// Parse return type.
let output = if self.eat(Token::Arrow).is_some() {
Some(self.parse_type()?.0)
self.parse_type()?.0
} else {
None
Type::Tuple(Vec::new())
};
// Parse the function body.

View File

@ -19,7 +19,8 @@ outputs:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":5,\\\"line_stop\\\":5,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const function x() { \\\"}\"}"
input: []
const_: true
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:
@ -61,7 +62,8 @@ outputs:
input:
- SelfKeyword: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":8,\\\"line_stop\\\":8,\\\"col_start\\\":22,\\\"col_stop\\\":26,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const function x(self) { \\\"}\"}"
const_: true
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:
@ -103,7 +105,8 @@ outputs:
input:
- ConstSelfKeyword: "{\"name\":\"const self\",\"span\":\"{\\\"line_start\\\":11,\\\"line_stop\\\":11,\\\"col_start\\\":22,\\\"col_stop\\\":32,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const function c(const self) { \\\"}\"}"
const_: true
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:
@ -158,7 +161,8 @@ outputs:
path: ""
content: " const function b(const self, x: u32) {"
const_: true
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:
@ -213,7 +217,8 @@ outputs:
path: ""
content: " const function b(const self, const x: u32) {"
const_: true
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -36,7 +36,8 @@ outputs:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x() {\\\"}\"}"
input: []
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:
@ -77,7 +78,8 @@ outputs:
identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function y() {\\\"}\"}"
input: []
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -16,7 +16,8 @@ outputs:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x() {\\\"}\"}"
input: []
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:
@ -57,7 +58,8 @@ outputs:
identifier: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":7,\\\"line_stop\\\":7,\\\"col_start\\\":14,\\\"col_stop\\\":15,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function y() {\\\"}\"}"
input: []
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:
@ -98,7 +100,8 @@ outputs:
identifier: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":10,\\\"line_stop\\\":10,\\\"col_start\\\":20,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const function z() {\\\"}\"}"
input: []
const_: true
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -17,7 +17,8 @@ outputs:
input:
- RefSelfKeyword: "{\"name\":\"&self\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":16,\\\"col_stop\\\":21,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x(&self) {\\\"}\"}"
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -17,7 +17,8 @@ outputs:
input:
- SelfKeyword: "{\"name\":\"self\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":16,\\\"col_stop\\\":20,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" function x(self) {\\\"}\"}"
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -237,7 +237,8 @@ outputs:
path: ""
content: "x(y)::y(x)"
name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x(y)::y(x)\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1

View File

@ -70,7 +70,8 @@ outputs:
inner:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y()\\\"}\"}"
name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y()\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -93,7 +94,8 @@ outputs:
inner:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y(x)\\\"}\"}"
name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y(x)\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1

View File

@ -7,7 +7,8 @@ outputs:
inner:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y\\\"}\"}"
name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -20,7 +21,8 @@ outputs:
inner:
Identifier: "{\"name\":\"X\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"X::Y\\\"}\"}"
name: "{\"name\":\"Y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"X::Y\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -36,7 +38,8 @@ outputs:
inner:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y::z\\\"}\"}"
name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y::z\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -45,7 +48,8 @@ outputs:
path: ""
content: "x::y::z"
name: "{\"name\":\"z\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y::z\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -60,7 +64,8 @@ outputs:
inner:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y()\\\"}\"}"
name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y()\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -84,7 +89,8 @@ outputs:
inner:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y.0\\\"}\"}"
name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y.0\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -109,7 +115,8 @@ outputs:
inner:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":2,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y[1u8]\\\"}\"}"
name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":4,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"x::y[1u8]\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1

View File

@ -51,7 +51,8 @@ outputs:
inner:
Identifier: "{\"name\":\"address\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":8,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"address::call()\\\"}\"}"
name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":10,\\\"col_stop\\\":14,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"address::call()\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -116,7 +117,8 @@ outputs:
inner:
Identifier: "{\"name\":\"bool\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"bool::call()\\\"}\"}"
name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"bool::call()\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -182,7 +184,8 @@ outputs:
inner:
Identifier: "{\"name\":\"char\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"char::call()\\\"}\"}"
name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"char::call()\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -247,7 +250,8 @@ outputs:
inner:
Identifier: "{\"name\":\"field\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"field::call()\\\"}\"}"
name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"field::call()\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -365,7 +369,8 @@ outputs:
inner:
Identifier: "{\"name\":\"group\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"group::call()\\\"}\"}"
name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":8,\\\"col_stop\\\":12,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"group::call()\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -563,7 +568,8 @@ outputs:
inner:
Identifier: "{\"name\":\"i8\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"i8::call()\\\"}\"}"
name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"i8::call()\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -586,7 +592,8 @@ outputs:
inner:
Identifier: "{\"name\":\"i16\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"i16::call()\\\"}\"}"
name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"i16::call()\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -609,7 +616,8 @@ outputs:
inner:
Identifier: "{\"name\":\"i32\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"i32::call()\\\"}\"}"
name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"i32::call()\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -632,7 +640,8 @@ outputs:
inner:
Identifier: "{\"name\":\"i64\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"i64::call()\\\"}\"}"
name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"i64::call()\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -655,7 +664,8 @@ outputs:
inner:
Identifier: "{\"name\":\"i128\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"i128::call()\\\"}\"}"
name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"i128::call()\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -853,7 +863,8 @@ outputs:
inner:
Identifier: "{\"name\":\"u8\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"u8::call()\\\"}\"}"
name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":9,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"u8::call()\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -876,7 +887,8 @@ outputs:
inner:
Identifier: "{\"name\":\"u16\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"u16::call()\\\"}\"}"
name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"u16::call()\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -899,7 +911,8 @@ outputs:
inner:
Identifier: "{\"name\":\"u32\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"u32::call()\\\"}\"}"
name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"u32::call()\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -922,7 +935,8 @@ outputs:
inner:
Identifier: "{\"name\":\"u64\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":4,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"u64::call()\\\"}\"}"
name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":6,\\\"col_stop\\\":10,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"u64::call()\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1
@ -945,7 +959,8 @@ outputs:
inner:
Identifier: "{\"name\":\"u128\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":1,\\\"col_stop\\\":5,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"u128::call()\\\"}\"}"
name: "{\"name\":\"call\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":7,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"u128::call()\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1

View File

@ -43,7 +43,8 @@ outputs:
inner:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"-x::y\\\"}\"}"
name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"-x::y\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1

View File

@ -43,7 +43,8 @@ outputs:
inner:
Identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":2,\\\"col_stop\\\":3,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"!x::y\\\"}\"}"
name: "{\"name\":\"y\",\"span\":\"{\\\"line_start\\\":1,\\\"line_stop\\\":1,\\\"col_start\\\":5,\\\"col_stop\\\":6,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"!x::y\\\"}\"}"
type_: ~
type_:
Tuple: []
span:
line_start: 1
line_stop: 1

View File

@ -25,7 +25,8 @@ outputs:
identifier: "{\"name\":\"a\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function a() {\\\"}\"}"
input: []
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:
@ -77,7 +78,8 @@ outputs:
identifier: "{\"name\":\"b\",\"span\":\"{\\\"line_start\\\":9,\\\"line_stop\\\":9,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function b() {\\\"}\"}"
input: []
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:
@ -129,7 +131,8 @@ outputs:
identifier: "{\"name\":\"c\",\"span\":\"{\\\"line_start\\\":14,\\\"line_stop\\\":14,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function c() {\\\"}\"}"
input: []
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:
@ -180,7 +183,8 @@ outputs:
identifier: "{\"name\":\"d\",\"span\":\"{\\\"line_start\\\":19,\\\"line_stop\\\":19,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function d() {\\\"}\"}"
input: []
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -26,7 +26,8 @@ outputs:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}"
input: []
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -35,7 +35,8 @@ outputs:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":4,\\\"line_stop\\\":4,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}"
input: []
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -28,7 +28,8 @@ outputs:
path: ""
content: "function x(const y: u32) {"
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -15,7 +15,8 @@ outputs:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":16,\\\"col_stop\\\":17,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"const function x() {\\\"}\"}"
input: []
const_: true
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -41,7 +41,8 @@ outputs:
path: ""
content: "function x(x: u32, const y: i32) {"
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:
@ -108,7 +109,8 @@ outputs:
path: ""
content: "function x(const x: u32, y: i32) {"
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -16,7 +16,8 @@ outputs:
input:
- ConstSelfKeyword: "{\"name\":\"const self\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":12,\\\"col_stop\\\":22,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x(const self) {\\\"}\"}"
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -15,7 +15,8 @@ outputs:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {\\\"}\"}"
input: []
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -15,7 +15,8 @@ outputs:
identifier: "{\"name\":\"x\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":11,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function x() {}\\\"}\"}"
input: []
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements: []

View File

@ -15,7 +15,8 @@ outputs:
identifier: "{\"name\":\"inf\",\"span\":\"{\\\"line_start\\\":3,\\\"line_stop\\\":3,\\\"col_start\\\":10,\\\"col_stop\\\":13,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function inf() {\\\"}\"}"
input: []
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -30,7 +30,8 @@ outputs:
path: ""
content: "function x(x: [u8; 12]) {"
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -28,7 +28,8 @@ outputs:
path: ""
content: "function x(x: MyCircuit) {"
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -30,7 +30,8 @@ outputs:
path: ""
content: "function x(x: (u32, i32)) {"
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -41,7 +41,8 @@ outputs:
path: ""
content: "function x(x: u32, y: i32) {"
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -688,7 +688,8 @@ outputs:
inner:
Identifier: "{\"name\":\"LinearRegression\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":31,\\\"col_stop\\\":47,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let reg: LinearRegression = LinearRegression::new(points);\\\"}\"}"
name: "{\"name\":\"new\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":49,\\\"col_stop\\\":52,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let reg: LinearRegression = LinearRegression::new(points);\\\"}\"}"
type_: ~
type_:
Tuple: []
arguments:
- Identifier: "{\"name\":\"points\",\"span\":\"{\\\"line_start\\\":63,\\\"line_stop\\\":63,\\\"col_start\\\":53,\\\"col_stop\\\":59,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" let reg: LinearRegression = LinearRegression::new(points);\\\"}\"}"
- Definition:

View File

@ -401,7 +401,8 @@ outputs:
identifier: "{\"name\":\"test_is_palindrome\",\"span\":\"{\\\"line_start\\\":54,\\\"line_stop\\\":54,\\\"col_start\\\":10,\\\"col_stop\\\":28,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\"function test_is_palindrome() {\\\"}\"}"
input: []
const_: false
output: ~
output:
Tuple: []
core_mapping: ~
block:
statements:

View File

@ -158,7 +158,8 @@ outputs:
inner:
Identifier: "{\"name\":\"PedersenHash\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":36,\\\"col_stop\\\":48,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const pedersen: PerdesenHash = PedersenHash::new(parameters);\\\"}\"}"
name: "{\"name\":\"new\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":50,\\\"col_stop\\\":53,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const pedersen: PerdesenHash = PedersenHash::new(parameters);\\\"}\"}"
type_: ~
type_:
Tuple: []
arguments:
- Identifier: "{\"name\":\"parameters\",\"span\":\"{\\\"line_start\\\":24,\\\"line_stop\\\":24,\\\"col_start\\\":54,\\\"col_stop\\\":64,\\\"path\\\":\\\"\\\",\\\"content\\\":\\\" const pedersen: PerdesenHash = PedersenHash::new(parameters);\\\"}\"}"
- Return: