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

The used list of keywords is from kotlin but should be for typescript #23

Open
Legion2 opened this issue Jul 24, 2023 · 2 comments
Open

Comments

@Legion2
Copy link

Legion2 commented Jul 24, 2023

The typescript builder checks names for keywords, but it uses a list of koltin keywords instead of a list of typescript keywords:

// https://github.com/JetBrains/kotlin/blob/master/core/descriptors/src/org/jetbrains/kotlin/renderer/KeywordStringsGenerated.java
private val KEYWORDS = setOf(
"package",
"as",
"typealias",
"class",
"this",
"super",
"val",
"var",
"fun",
"for",
"null",
"true",
"false",
"is",
"in",
"throw",
"return",
"break",
"continue",
"object",
"if",
"try",
"else",
"while",
"do",
"when",
"interface",
"typeof"
)

The list is missing they keyword enum as an example (which is also a keyword in kotlin).

@kdubb
Copy link
Contributor

kdubb commented Jul 25, 2023

You are correct! Both the Swift and TypeScript poets originated from meddling with the Kotlin & Java Poets; there are deficiencies.

Welcome any PRs or information you can contribute. Specifically, where the TS keyword list is defined would be very helpful.

@Legion2
Copy link
Author

Legion2 commented Jul 25, 2023

I found this in the official typescript parser source code: https://github.com/microsoft/TypeScript/blob/b1bec34f20690c6fdf6cc6e3d8cacee1e075f5ae/src/compiler/types.ts#L141

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

No branches or pull requests

2 participants