Skip to content

Commit bf4a4af

Browse files
authored
Merge pull request #37382 from kimdv/kimdv/fix-wrong-child-syntax-kind
[SwiftSyntax]: Use check for suffix instead of contains when checking for token
2 parents b0bade6 + 779365c commit bf4a4af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils/gyb_syntax_support/Child.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ def __init__(self, name, kind, description=None, is_optional=False,
3333
self.is_indented = is_indented
3434
self.requires_leading_newline = requires_leading_newline
3535

36-
# If the child has "token" anywhere in the kind, it's considered
36+
# If the child ends with "token" in the kind, it's considered
3737
# a token node. Grab the existing reference to that token from the
3838
# global list.
3939
self.token_kind = \
40-
self.syntax_kind if "Token" in self.syntax_kind else None
40+
self.syntax_kind if self.syntax_kind.endswith("Token") else None
4141
self.token = SYNTAX_TOKEN_MAP.get(self.token_kind)
4242

4343
self.is_optional = is_optional

0 commit comments

Comments
 (0)