Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
robpike opened this issue Apr 6, 2022 · 1 comment
Closed

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

robpike opened this issue Apr 6, 2022 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@robpike
Copy link
Contributor

robpike commented Apr 6, 2022

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.

@robpike robpike self-assigned this Apr 6, 2022
@ianlancetaylor ianlancetaylor changed the title tex/template/parse: give the lexer more lookahead text/template/parse: give the lexer more lookahead Apr 6, 2022
@ianlancetaylor ianlancetaylor added this to the Backlog milestone Apr 6, 2022
@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Apr 6, 2022
@gopherbot
Copy link

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

@dmitshur dmitshur modified the milestones: Backlog, Go1.19 May 16, 2022
@rsc rsc unassigned robpike Jun 22, 2022
@golang golang locked and limited conversation to collaborators Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants