google / cel-spec

Common Expression Language -- specification and binary representation
https://cel.dev
Apache License 2.0
2.59k stars 216 forks source link

What does the `~*` mean? #343

Closed gnclmorais closed 3 months ago

gnclmorais commented 3 months ago

I’m looking to port CEL into a Lezer perser but I’m struggling to understand something on the lexis:

STRING_LIT     ::= [rR]? ( "    ~( " | NEWLINE )*  "
                         | '    ~( ' | NEWLINE )*  '
                         | """  ~"""*              """
                         | '''  ~'''*              '''
                         )

What does the tilde-asterisk (~XXX*) combo mean?

jnthntatum commented 3 months ago

It means negation (so include anything up until the closing """ for a multiline string in that case).