graalphp
graalphp copied to clipboard
Integrate source section in error handling
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.
We currently throw UnsupportedOperationException if syntactic errors occur. Replace exception with graaphp specific exception which also prints source section. See ExprVisitor.