Skip to content

No line numbers for errors discovered in lrpar/ctbuilder.rs #623

@ltratt

Description

@ltratt

The error messages we get from yacc/parser.rs are really helpful, but if the text gets through to ctbuilder.rs the errors are less helpful. Consider:

FuncAttrs -> Result<Vec<AstFuncAttr>, Box<dyn Error>>:
    FuncAttrs FuncAttr { flattenr($1, $) }

The error one gets is:

Unknown text following '$' operator: $)

without a line number (and also repeating the $ character; I think the relevant code &pre_action[last + off..] is missing a +1). That can make tracking the problem down a little frustrating. Given we have token_span in YaccGrammar can we also record and pass through the span of action text? Then ctbuilder.rs could give line/column warnings for such errors.

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