google / cel-go

Fast, portable, non-Turing complete expression evaluation with gradual typing (Go)
https://cel.dev
Apache License 2.0
2.31k stars 225 forks source link

Delete dangling source info from macro expansion #934

Closed jcking closed 7 months ago

jcking commented 7 months ago

When checking if something is a regular call or macro in the parser, we reserve an ID ahead of time and associate location information with it. When the call turns out to be a macro, the ID becomes unused but the source information is left. This change introduces logic to remove the excess information and potentially re-use the ID if we can.