~This builds on top of #159 so is in draft for now, once that's merged I will rebase.~
Adds support for using extend type <name> in a modular model, the strategy for doing this was to track whether we are processing a modular model (i.e. whether we encountered the module keyword) and then in the typedef handler we check if the extend keyword was used and add an error if the model we're processing is not a modular model.
I had initially investigated attempting to use semantic predicates to achieve this in the lexer but I think that involves larger scale changes such as adding a superClass for the antlr generated lexer to extend so we can write functions like IsModularModel to use in our grammar.
I think there will need to be some metadata added to track this but wanted to get a PR up to make sure I'm treading the right path.
[ ] I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
[x] The correct base branch is being used, if not main
[ ] I have added tests to validate that the change in functionality is working as expected
Description
~This builds on top of #159 so is in draft for now, once that's merged I will rebase.~
Adds support for using
extend type <name>
in a modular model, the strategy for doing this was to track whether we are processing a modular model (i.e. whether we encountered themodule
keyword) and then in the typedef handler we check if theextend
keyword was used and add an error if the model we're processing is not a modular model.I had initially investigated attempting to use semantic predicates to achieve this in the lexer but I think that involves larger scale changes such as adding a superClass for the antlr generated lexer to extend so we can write functions like
IsModularModel
to use in our grammar.I think there will need to be some metadata added to track this but wanted to get a PR up to make sure I'm treading the right path.
References
Review Checklist
main