openfga / language

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

Make line and column numbers zero based #223

Closed ewanharris closed 6 months ago

ewanharris commented 6 months ago

Description

Makes the line and column numbers for the various errors 0 based, we were mostly 1 based already with the exception of some oversights (Go default error in some modular cases) and the line (but not column) on syntax errors from antlr.

This is separated into different commits for the tests and each language to help with review. There is a little bit of awkwardness in that we don't assert the errors in Go and Java due to differences in the errors across languages, but it shouldn't be an issue.

References

Review Checklist

ewanharris commented 6 months ago

@rhamzeh thinking about future us is too smart! 😆 I've pushed some comments to our SyntaxError function for each language to document it.