Skip to content

Remove string-based reference of tokens in CodeGeneration #1978

Closed
@ahoppen

Description

@ahoppen

CodeGeneration currently refers to tokens e.g. as IdentifierToken. That string-based reference isn’t very idiomatic Swift. What we should have instead is a Token enum of all the possible tokens in TokenSpec.swift, a computed property on that enum that returns the corresponding TokenSpec of that token. We could then use members of the Token enum to refer to the token kinds, instead of the string-based reference.

Metadata

Metadata

Assignees

Labels

CodeGenerationChanges to the CodeGeneration package that generates code in swift-syntaxrefactoringAn internal refactoring of the codebase

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions