openfga / language

Grammar for the OpenFGA modeling language
https://openfga.dev
Apache License 2.0
16 stars 7 forks source link

chore: refactor CEL grammar to use modes #109

Closed d-jeffery closed 7 months ago

d-jeffery commented 9 months ago

Description

Following PR is a cleanup demonstrating push/pop mode of defining CEL as an island grammar within OpenFGA.

Currently both CEL and OpenFGA grammars are mixed together. This change provides isolation of the CEL grammar between { } in the Lexer configuration, removing the need to have the Parser directly define a list of CEL tokens.

This is desirable because we are not doing semantic validation of CEL expressions, and only need to know what symbols are available for tokenization. This reduces the complexity of the Paser definition, and adds some resiliency for changes.

// TODO: Fix validation tests to use new symbol definitions in their comparisons.

References

Review Checklist

d-jeffery commented 7 months ago

Closing in favor of using either imports, or refreshing modes.