Skip to content

Error recovery ideas #342

@alecthomas

Description

@alecthomas

Implement a RecoverToNext(token...string) option that allows resumption from synchronisation tokens. eg. a language might choose statement keywords like if, while, etc. as synchronisation tokens.

Edit: it might be better to specify a list of nodes to recover to, or generate a mapping of token value to node. The parser would then traverse up from the failing node to the nearest recovery node and attempt to match the token for that node. eg. if, while, etc. might map to the Statement node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions