graalphp icon indicating copy to clipboard operation
graalphp copied to clipboard

Integrate source section in error handling

Open abertschi opened this issue 5 years ago • 1 comments

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 avatar Aug 18 '20 11:08 abertschi

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

abertschi avatar Aug 18 '20 12:08 abertschi