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

The library cannot handle "3-1"? #119

Open
leojay opened this issue Dec 23, 2024 · 1 comment
Open

The library cannot handle "3-1"? #119

leojay opened this issue Dec 23, 2024 · 1 comment

Comments

@leojay
Copy link

leojay commented Dec 23, 2024

My code:

use cel_interpreter::Program;


fn main() {
    Program::compile("3-1").unwrap();
}

I expect this code to run without any issue, but the actual result:

$ cargo run
   Compiling pubsub v0.1.0 (/home/user/test)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.48s
     Running `target/debug/test`
thread 'main' panicked at src/main.rs:5:29:
called `Result::unwrap()` on an `Err` value: ParseError { msg: "unrecognized token: '-1'", expected: ["\"!=\"", "\"%\"", "\"&&\"", "\"*\"", "\"+\"", "\"-\"", "\".\"", "\"/\"", "\"<\"", "\"<=\"", "\"==\"", "\">\"", "\">=\"", "\"?\"", "\"[\"", "\"in\"", "\"{\"", "\"||\""], span: Span { start: Some(Location { line: 0, column: 1, absolute: 1 }), end: Some(Location { line: 0, column: 3, absolute: 3 }) } }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@Masterlvng
Copy link
Contributor

Yes, it might be that the CEL parser is not handling the '-' sign properly.

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

No branches or pull requests

2 participants