Skip to content

[SwiftSyntax]: Use check for suffix instead of contains when checking for token #37382

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 1 commit into from
May 14, 2021
Merged
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
4 changes: 2 additions & 2 deletions utils/gyb_syntax_support/Child.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ def __init__(self, name, kind, description=None, is_optional=False,
self.is_indented = is_indented
self.requires_leading_newline = requires_leading_newline

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

self.is_optional = is_optional
Expand Down