citron icon indicating copy to clipboard operation
citron copied to clipboard

More sourceLocation()s

Open dabrahams opened this issue 2 years ago • 0 comments

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.

dabrahams avatar May 24 '22 18:05 dabrahams