Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate source section in error handling #48

Open
abertschi opened this issue Aug 18, 2020 · 1 comment
Open

Integrate source section in error handling #48

abertschi opened this issue Aug 18, 2020 · 1 comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers graaphp-language

Comments

@abertschi
Copy link
Owner

When bailing out with an error, print where in source error occurred. We already set source section in ast visitor but do not print it in error cases.

Decide if early or lazy loading is better for graalphp.

  • pro for eager: we may implement phpdoc semantics into parsing (types)
  • however, new versions of php support type hints and dont have to rely on comments
  • i think for now we lazy load source section with index and length and fetch when needed.
@abertschi abertschi added documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers graaphp-language labels Aug 18, 2020
@abertschi
Copy link
Owner Author

abertschi commented Aug 18, 2020

We currently throw UnsupportedOperationException if syntactic errors occur. Replace exception with graaphp specific exception which also prints source section. See ExprVisitor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers graaphp-language
Projects
None yet
Development

No branches or pull requests

1 participant