Merge pull request #572 from powdr-labs/move_function_call

Move FunctionCall.
This commit is contained in:
chriseth
2023-09-07 15:05:37 +02:00
committed by GitHub
4 changed files with 7 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
use std::{iter::once, ops::ControlFlow};
use crate::parsed::{asm::FunctionCall, Expression};
use crate::parsed::{Expression, FunctionCall};
use super::FunctionStatement;

View File

@@ -132,15 +132,3 @@ pub struct Param {
pub name: String,
pub ty: Option<String>,
}
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)]
pub struct FunctionCall<T> {
pub id: String,
pub arguments: Vec<Expression<T>>,
}
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)]
pub enum PlookupOperator {
In,
Is,
}

View File

@@ -253,15 +253,6 @@ impl<T: Display> Display for FunctionCall<T> {
}
}
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!(

View File

@@ -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<T>(pub Vec<PilStatement<T>>);
@@ -275,6 +273,12 @@ pub enum BinaryOperator {
ShiftRight,
}
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)]
pub struct FunctionCall<T> {
pub id: String,
pub arguments: Vec<Expression<T>>,
}
/// The definition of a function (excluding its name):
/// Either a param-value mapping or an array expression.
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)]