Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support operator associativity #23

Merged
merged 1 commit into from
Dec 16, 2023

Conversation

ashyanSpada
Copy link
Owner

No description provided.

@@ -3,7 +3,9 @@
use crate::descriptor::DescriptorManager;
use crate::error::Error;
use crate::function::InnerFunctionManager;
use crate::operator::{BinOpType, BinaryOpFuncManager, PostfixOpFuncManager, UnaryOpFuncManager};
use crate::operator::{
BinaryOpConfig, BinaryOpFuncManager, BinaryOpType, PostfixOpFuncManager, UnaryOpFuncManager,

Check warning

Code scanning / clippy

unused import: BinaryOpConfig Warning

unused import: BinaryOpConfig
BinOpType::CALC => BinaryOpFuncManager::new().get(&op)?(lhs.exec(ctx)?, rhs.exec(ctx)?),
BinOpType::SETTER => {
BinaryOpType::CALC => {
BinaryOpFuncManager::new().get_handler(&op)?(lhs.exec(ctx)?, rhs.exec(ctx)?)

Check warning

Code scanning / clippy

this expression creates a reference which is immediately dereferenced by the compiler Warning

this expression creates a reference which is immediately dereferenced by the compiler
let (a, b) = (lhs.exec(ctx)?, rhs.exec(ctx)?);
ctx.set_variable(
lhs.get_reference_name()?,
BinaryOpFuncManager::new().get(&op)?(a, b)?,
BinaryOpFuncManager::new().get_handler(&op)?(a, b)?,

Check warning

Code scanning / clippy

this expression creates a reference which is immediately dereferenced by the compiler Warning

this expression creates a reference which is immediately dereferenced by the compiler
CALC,
SETTER,
}

#[derive(Clone, PartialEq)]
pub enum BinaryOpAssociativity {
LEFT,

Check warning

Code scanning / clippy

name LEFT contains a capitalized acronym Warning

name LEFT contains a capitalized acronym
#[derive(Clone, PartialEq)]
pub enum BinaryOpAssociativity {
LEFT,
RIGHT,

Check warning

Code scanning / clippy

name RIGHT contains a capitalized acronym Warning

name RIGHT contains a capitalized acronym
@ashyanSpada ashyanSpada merged commit 5a24fb6 into master Dec 16, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant