--
You received this message because you are subscribed to the Google Groups "CEL Go Discussion Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cel-go-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cel-go-discuss/b3579d68-e1c0-49e4-9771-964dd1393cfao%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cel-go-discuss/CAHx9AioAtkfwXm4C5%3DfcXWSGR8GEMFtJ%2BLwK9nAsz2PfbjEV9Q%40mail.gmail.com.
stmts: - init: givenNameExists = context.userExists && has(user.name.givenName) && user.name.givenName != "" - init: familyNameExists = context.userExists && has(user.name.familyName) && user.name.familyName != "" - init: formattedExists = context.userExists && has(user.name.formatted) && user.name.formatted != "" - if: match: context.formattedExists block: - ret: user.name.formatted eifs: - match: context.givenNameExists block: - if: match: context.familyNameExists block: - ret: user.name.familyName + ", " + user.name.givenName else: - ret: user.name.givenName - match: context.familyNameExists block: - ret: user.name.familyNameHi Vivek,If you're looking for an example of assignments, I would recommend looking over https://github.com/google/cel-policy-templates-go for how we combined CEL + YAML for making assignments and more complex logical constructs. CEL will forever remain small so that it more easily be embedded into larger frameworks. The moment we introduce assignments, we'll increase the analytical complexity of the core language in ways that would be undesirable.If you're looking for tips on how to embed CEL into a larger ANTLR grammar, I can provide some examples there as well.-Tristan
On Fri, Jul 10, 2020 at 7:24 PM Vivek Shankar <viv.s...@gmail.com> wrote:
Hi,--I have been using CEL in my product as an engine to execute user-authored "code" and it works great. I am working on a multi-line capability, but I was wondering if there were any thoughts on adding two things to the parser -
- An end-of-line terminator: Like semi-colon in certain languages
- An assignment operator: I know this opens up scoping of variables etc. but it might be possible to define certain caveats. For example, you can't define the same var name in a sub-frame.
This would save me the need to write my own parser.
You received this message because you are subscribed to the Google Groups "CEL Go Discussion Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cel-go-...@googlegroups.com.
Just in case it's helpful... you might want to look into cue as well (in go, also by Google).
On Mon, 13 Jul 2020, 18:40 'Tristan Swadell' via CEL Go Discussion Forum, <cel-go-...@googlegroups.com> wrote:
Hi Vivek,If you're looking for an example of assignments, I would recommend looking over https://github.com/google/cel-policy-templates-go for how we combined CEL + YAML for making assignments and more complex logical constructs. CEL will forever remain small so that it more easily be embedded into larger frameworks. The moment we introduce assignments, we'll increase the analytical complexity of the core language in ways that would be undesirable.If you're looking for tips on how to embed CEL into a larger ANTLR grammar, I can provide some examples there as well.-Tristan
On Fri, Jul 10, 2020 at 7:24 PM Vivek Shankar <viv.s...@gmail.com> wrote:
Hi,--I have been using CEL in my product as an engine to execute user-authored "code" and it works great. I am working on a multi-line capability, but I was wondering if there were any thoughts on adding two things to the parser -
- An end-of-line terminator: Like semi-colon in certain languages
- An assignment operator: I know this opens up scoping of variables etc. but it might be possible to define certain caveats. For example, you can't define the same var name in a sub-frame.
This would save me the need to write my own parser.
You received this message because you are subscribed to the Google Groups "CEL Go Discussion Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cel-go-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cel-go-discuss/b3579d68-e1c0-49e4-9771-964dd1393cfao%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "CEL Go Discussion Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cel-go-...@googlegroups.com.