Skip to content

Update GYB Files for SwiftSyntax Double and Int Convenience Properties #33948

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
Sep 19, 2020
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
6 changes: 4 additions & 2 deletions utils/gyb_syntax_support/ExprNodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@
Node('FloatLiteralExpr', kind='Expr',
children=[
Child('FloatingDigits', kind='FloatingLiteralToken'),
]),
],
must_uphold_invariant=True),

Node('TupleExpr', kind='Expr',
traits=['Parenthesized'],
Expand Down Expand Up @@ -282,7 +283,8 @@
Node('IntegerLiteralExpr', kind='Expr',
children=[
Child('Digits', kind='IntegerLiteralToken'),
]),
],
must_uphold_invariant=True),

# true or false
Node('BooleanLiteralExpr', kind='Expr',
Expand Down
5 changes: 4 additions & 1 deletion utils/gyb_syntax_support/Node.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class Node(object):

def __init__(self, name, description=None, kind=None, traits=None,
children=None, element=None, element_name=None,
element_choices=None, omit_when_empty=False):
element_choices=None, omit_when_empty=False,
must_uphold_invariant=False):
self.syntax_kind = name
self.swift_syntax_kind = lowercase_first_word(name)
self.name = kind_to_type(self.syntax_kind)
Expand All @@ -39,6 +40,8 @@ def __init__(self, name, description=None, kind=None, traits=None,

self.omit_when_empty = omit_when_empty
self.collection_element = element or ""
self.must_uphold_invariant = must_uphold_invariant

# For SyntaxCollections make sure that the element_name is set.
assert(not self.is_syntax_collection() or element_name or
(element and element != 'Syntax'))
Expand Down