Skip to content

startPos parser option to complement startLine #13884

@tolmasky

Description

@tolmasky

💻

  • Would you like to work on this feature?

What problem are you trying to solve?

You can use startLine, but unfortunately there seems to be no way to also modify pos to match. This unfortunately means that the AST interacts poorly with source mapping.

Describe the solution you'd like

Just adding a startPos should fix this.

Describe alternatives you've considered

We currently append a huge string at the beginning of our code with the number of spaces equal to the position offset. This is very inefficient and just inelegant. By just having a startPos the code would be way faster, simpler, and just all around better.

Documentation, Adoption, Migration Strategy

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    i: needs triageoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions