Skip to content

ability to emit warnings and halt compilation #68

Open
@kurtbrose

Description

@kurtbrose

parsley.ometa.runtime.ParseError has a very nice way of formatting / printing error messages

It would be nice if there was some way to access this from the grammar rules. For example, if there was a type of exception that would be picked up and have the line and character added.

Also, it would be nice if there was a way to emit a warning with a given message formatted in the same way as the ParseError.

(This can kinda-sorta be achieved via print str(grammar.input.head()[1].withMessage("whatever warning"), but there doesn't seem to be a way to get access to the grammar object itself from inside a rule.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions