Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More sourceLocation()s #26

Open
dabrahams opened this issue May 24, 2022 · 0 comments
Open

More sourceLocation()s #26

dabrahams opened this issue May 24, 2022 · 0 comments

Comments

@dabrahams
Copy link
Contributor

There are more opportunities for good error reporting by adding more sourceLocations, e.g in this excerpt of generated code,

    enum CitronSymbol {
        case yyBaseOfStack
        case yy0(CitronToken)
        case yy7(EBNF.AltList)
        case yy17(EBNF.Alt)
        case yy26(EBNF.TermList)
        case yy40(EBNF.RuleList)
        case yy46(EBNF.Term)
        case yy52(EBNF.Rule.Kind)
        case yy56(EBNF.Rule)

Each of these case lines corresponds to a place in the original source where the type was declared for a nonterminal. If I got the spellings of those types wrong, I'll see errors in the generated .swift file rather than in the citron input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant