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

refactor: migrate to Go parser instead of using heuristics #461

Merged
merged 19 commits into from
Jan 29, 2024
Merged

Conversation

a-h
Copy link
Owner

@a-h a-h commented Jan 25, 2024

This should make parsing Go code within templ files more robust, since it uses the actual Go parser.

@a-h a-h marked this pull request as ready for review January 25, 2024 21:21
@a-h a-h requested a review from joerdav January 25, 2024 21:21
Copy link
Collaborator

@joerdav joerdav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks awesome, big fan of the go parse tests, should be really easy to add new ones without it becoming a huge unreadable file!

Just added a couple nits and some typos I spotted.

parser/v2/conditionalattributeparser.go Show resolved Hide resolved
parser/v2/goexpression/parse.go Outdated Show resolved Hide resolved
parser/v2/goexpression/parse.go Outdated Show resolved Hide resolved
parser/v2/templelementparser.go Outdated Show resolved Hide resolved
@a-h a-h merged commit 3de67f6 into main Jan 29, 2024
5 of 6 checks passed
@a-h a-h deleted the go_ast_v2 branch January 29, 2024 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants