Skip to content

Remove string-based reference of keyword tokens in CodeGeneration #2008

Closed
@Matejkob

Description

@Matejkob

It would be a task for a follow-up PR to keep this PR easier to review but it would be nice to do the same thing you’re doing for TokenSpec also for KeywordSpec, so that the last element of this array could become .keyword(.`self`).

Originally posted by @ahoppen in #2006 (comment)

In line with the recent refactor that replaced string-based references with a Token enum in CodeGeneration, this issue proposes to extend the same approach to KeywordSpec. Currently, KeywordSpec entries are referred to in a string-based manner that does not follow idiomatic Swift practices.

This issue aims to create a Keyword enum in the KeywordSpec.swift file, encompassing all possible keywords. This enum should also have a computed property that returns the corresponding KeywordSpec for a given keyword.

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