From 81537ea1bb0f86e9432c9309c7096cdebc594d00 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 6 Sep 2023 19:16:15 +0200 Subject: [PATCH] Move FunctionCall. --- ast/src/asm_analysis/utils.rs | 2 +- ast/src/parsed/asm.rs | 12 ------------ ast/src/parsed/display.rs | 9 --------- ast/src/parsed/mod.rs | 8 ++++++-- 4 files changed, 7 insertions(+), 24 deletions(-) diff --git a/ast/src/asm_analysis/utils.rs b/ast/src/asm_analysis/utils.rs index 4711357cd..694b931e2 100644 --- a/ast/src/asm_analysis/utils.rs +++ b/ast/src/asm_analysis/utils.rs @@ -1,6 +1,6 @@ use std::{iter::once, ops::ControlFlow}; -use crate::parsed::{asm::FunctionCall, Expression}; +use crate::parsed::{Expression, FunctionCall}; use super::FunctionStatement; diff --git a/ast/src/parsed/asm.rs b/ast/src/parsed/asm.rs index 5c7e1c545..49b3d1e44 100644 --- a/ast/src/parsed/asm.rs +++ b/ast/src/parsed/asm.rs @@ -132,15 +132,3 @@ pub struct Param { pub name: String, pub ty: Option, } - -#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)] -pub struct FunctionCall { - pub id: String, - pub arguments: Vec>, -} - -#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)] -pub enum PlookupOperator { - In, - Is, -} diff --git a/ast/src/parsed/display.rs b/ast/src/parsed/display.rs index 5f982c0e7..629fc5405 100644 --- a/ast/src/parsed/display.rs +++ b/ast/src/parsed/display.rs @@ -253,15 +253,6 @@ impl Display for FunctionCall { } } -impl Display for PlookupOperator { - fn fmt(&self, f: &mut Formatter<'_>) -> Result { - match self { - PlookupOperator::In => write!(f, "in"), - PlookupOperator::Is => write!(f, "is"), - } - } -} - impl Display for Param { fn fmt(&self, f: &mut Formatter<'_>) -> Result { write!( diff --git a/ast/src/parsed/mod.rs b/ast/src/parsed/mod.rs index 084846a26..b8d2f2b6b 100644 --- a/ast/src/parsed/mod.rs +++ b/ast/src/parsed/mod.rs @@ -5,8 +5,6 @@ use std::{iter::once, ops::ControlFlow}; use number::{DegreeType, FieldElement}; -use self::asm::FunctionCall; - #[derive(Debug, PartialEq, Eq)] pub struct PILFile(pub Vec>); @@ -275,6 +273,12 @@ pub enum BinaryOperator { ShiftRight, } +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)] +pub struct FunctionCall { + pub id: String, + pub arguments: Vec>, +} + /// The definition of a function (excluding its name): /// Either a param-value mapping or an array expression. #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)]