clarkmcc / cel-rust

Common Expression Language interpreter written in Rust
https://crates.io/crates/cel-interpreter
MIT License
377 stars 21 forks source link

Context.clone() method used by macros is private to the crate #30

Closed St4NNi closed 9 months ago

St4NNi commented 9 months ago

The official cel-spec has some additional macros / functions that might be useful for some of our use cases like: exists or exists_one.

Unfortunately I am not able to implement them by myself because: Context.clone() is pub(crate) and not pub:

https://github.com/clarkmcc/cel-rust/blob/f4fa854f7b2ed0e9b41a9f1c477dc8d30dbdbeb6/interpreter/src/context.rs#L115

Am I missing something or wouldn't it be useful to provide the clone functionality and context shadowing also for custom extension functions?

clarkmcc commented 9 months ago

Hi! Yes, it definitely makes sense to expose that. I'll get a fix released. Thanks!

Also, feel free to create PRs for anything missing from the spec. I know it's not fully up to spec today, but that's definitely the goal.

clarkmcc commented 9 months ago

Fixed. Using the master branch you should be able to clone the context now. I created a new issue #32 for the missing macros.