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?
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 index0. It seems all tokens insideIfTaghave indexes in relation to theIfTagitself. Is this by design? If so, is there any way to use the AST to find the position of child tokens insideIfTagin relation to the whole input text?