Skip to content
This repository was archived by the owner on May 19, 2018. It is now read-only.
/ babylon Public archive
This repository was archived by the owner on May 19, 2018. It is now read-only.

Error Recovery #347

@jamiebuilds

Description

@jamiebuilds

Right now whenever Babylon comes across a syntax error it immediately throws an error and tosses out the AST. While this is okay for a compiler pipeline where we want don't want to attempt transforming a broken AST, it's not okay for other types of tooling.

For example, there's plenty of tooling that needs to run in your editor while you are typing. If you are in the middle of typing code, you often have a half-finished/invalid program. But this is when editor tooling is most useful because a lot of it's there to help finish what you're typing.

I think the best way to approach this would be to start by removing all the throw-s from the parser code and replace them by pushing to an errors array. Then we can start to identify all the places where we'll have to make a decision on how to continue building the AST.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions