Skip to content

All end/begin positions of IdentifierTokens start at 0 inside IfTag #746

Description

@blidblid

I am trying to build a Liquid code editor using liquidjs.

When creating an AST of this code

{% if customer.name == "kevin" %}
  Hey Kevin!
{% elsif customer.name == "anonymous" %}
  Hey Anonymous!
{% else %}
  Hi Stranger!
{% endif %}

All identifier tokens inside branches[0].value.initial.postfix[0] begin at index 0. It seems all tokens inside IfTag have indexes in relation to the IfTag itself. Is this by design? If so, is there any way to use the AST to find the position of child tokens inside IfTag in relation to the whole input text?

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions