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

Restore error handling/suggestions for keywords in place of missing semicolons #432

Closed
wants to merge 2 commits into from

Conversation

DanielRosenwasser
Copy link
Member

Addresses some differences found in #425.

@@ -1879,6 +1879,14 @@ func GetIdentifierToken(str string) ast.Kind {
return ast.KindIdentifier
}

func AllKeywords() []string {
keywords := make([]string, 0, len(textToKeyword))
Copy link
Member

Choose a reason for hiding this comment

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

This func could just be maps.Keys, or better, a global rather than recalculating each call.

Copy link
Member

@jakebailey jakebailey Mar 8, 2025

Choose a reason for hiding this comment

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

Or, var AllKeywords = sync.OnceFunc(func() []string { ... }) or something.

@jakebailey
Copy link
Member

Was done in #641

@jakebailey jakebailey closed this Mar 17, 2025
@jakebailey jakebailey deleted the keywordErrorMessages branch March 21, 2025 18:09
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.

2 participants