Skip to content

text/template/parse: give the lexer more lookahead #52191

Closed
@robpike

Description

@robpike

https://go-review.googlesource.com/c/go/+/398475 and its issue #52165 are triggered by an inability to do sufficient lookahead, but that should be easy to do(but isn't) as the lexer operates on the full string. The submitted fix is clumsy but should be as easy as a call to strings.HasPrefix, and I want to make it that easy.

The lexer in robpike.io/ivy originated with this code but has been updated to avoid this problem. Do the same to text/template/parse. The required changes are modest and will not affect the public interface.

Activity

self-assigned this
on Apr 6, 2022
changed the title [-]tex/template/parse: give the lexer more lookahead[/-] [+]text/template/parse: give the lexer more lookahead[/+] on Apr 6, 2022
added this to the Backlog milestone on Apr 6, 2022
added
NeedsFixThe path to resolution is known, but the work has not been done.
on Apr 6, 2022
gopherbot

gopherbot commented on May 15, 2022

@gopherbot
Contributor

Change https://go.dev/cl/406476 mentions this issue: text/template/parse: make atTerminator more efficient

modified the milestones: Backlog, Go1.19 on May 16, 2022
locked and limited conversation to collaborators on Jun 22, 2023
added a commit that references this issue on Sep 19, 2024
053b63c
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

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @dmitshur@ianlancetaylor@robpike@gopherbot

        Issue actions

          text/template/parse: give the lexer more lookahead · Issue #52191 · golang/go