Skip to content

[SwiftSyntax] Add contextual_keyword and string_interpolation_anchor token kinds #13321

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions test/SwiftSyntax/ParseFile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import SwiftSyntax

var ParseFile = TestSuite("ParseFile")

struct Foo {
public let x: Int
private(set) var y: [Bool]
}

ParseFile.test("ParseSingleFile") {
let currentFile = URL(fileURLWithPath: #file)
expectDoesNotThrow({
Expand Down
2 changes: 2 additions & 0 deletions utils/gyb_syntax_support/Token.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ def __init__(self, name, text):
Token('IntegerLiteral', 'integer_literal'),
Token('FloatingLiteral', 'floating_literal'),
Token('StringLiteral', 'string_literal'),
Token('StringInterpolationAnchor', 'string_interpolation_anchor'),
Token('ContextualKeyword', 'contextual_keyword'),
]

SYNTAX_TOKEN_MAP = {token.name + 'Token': token for token in SYNTAX_TOKENS}