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

[AST Builder] Implement Unary Operators #662

Closed
ding-young opened this issue Jul 23, 2022 · 0 comments · Fixed by #669
Closed

[AST Builder] Implement Unary Operators #662

ding-young opened this issue Jul 23, 2022 · 0 comments · Fixed by #669
Assignees
Labels
enhancement New feature or request

Comments

@ding-young
Copy link
Contributor

Description

Implement unary operators (plus, minus, not, factorial) in ast_builder

Background

refer issue #614

Task

#[test]
    fn unary_op() {
        let actual = num(5).plus();
        let expected = "+5";
        test_expr(actual, expected);
        
        let actual = num(10).minus();
        let expected = "-10";
        test_expr(actual, expected);

        let actual = (col("count").gt(num(5))).not();
        let expected = "NOT count > 5";
        test_expr(actual, expected);

        let actual = num(10).factorial();
        let expected = "10!";
        test_expr(actual, expected);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants