Description
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 forKeywordSpec
, 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.