Skip to content

Commit 96a38f6

Browse files
authored
Merge pull request #27945 from ahoppen/multiline-generated-comments
[gyb_syntax_support] Make node descriptions multi-line
2 parents 869f8b4 + 1ebf2f2 commit 96a38f6

File tree

3 files changed

+43
-43
lines changed

3 files changed

+43
-43
lines changed

utils/gyb_syntax_support/AttributeNodes.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
Child('NamedAttributeString',
6464
kind='NamedAttributeStringArgument'),
6565
], description='''
66-
The arguments of the attribute. In case the attribute \
67-
takes multiple arguments, they are gather in the \
66+
The arguments of the attribute. In case the attribute
67+
takes multiple arguments, they are gather in the
6868
appropriate takes first.
6969
'''),
7070
Child('RightParen', kind='RightParenToken', is_optional=True,
@@ -105,7 +105,7 @@
105105
# labeled-specialize-entry -> identifier ':' token ','?
106106
Node('LabeledSpecializeEntry', kind='Syntax',
107107
description='''
108-
A labeled argument for the `@_specialize` attribute like \
108+
A labeled argument for the `@_specialize` attribute like
109109
`exported: true`
110110
''',
111111
traits=['WithTrailingComma'],
@@ -125,8 +125,8 @@
125125
# named-attribute-string-arg -> 'name': string-literal
126126
Node('NamedAttributeStringArgument', kind='Syntax',
127127
description='''
128-
The argument for the `@_dynamic_replacement` or `@_private` \
129-
attribute of the form `for: "function()"` or `sourceFile: \
128+
The argument for the `@_dynamic_replacement` or `@_private`
129+
attribute of the form `for: "function()"` or `sourceFile:
130130
"Src.swift"`
131131
''',
132132
children=[
@@ -149,7 +149,7 @@
149149
]),
150150
Child('DeclNameArguments', kind='DeclNameArguments',
151151
is_optional=True, description='''
152-
The argument labels of the protocol\'s requirement if it \
152+
The argument labels of the protocol\'s requirement if it
153153
is a function requirement.
154154
'''),
155155
]),
@@ -158,12 +158,12 @@
158158
# (identifier | operator) decl-name-arguments
159159
Node('ImplementsAttributeArguments', kind='Syntax',
160160
description='''
161-
The arguments for the `@_implements` attribute of the form \
161+
The arguments for the `@_implements` attribute of the form
162162
`Type, methodName(arg1Label:arg2Label:)`
163163
''',
164164
children=[
165165
Child('Type', kind='SimpleTypeIdentifier', description='''
166-
The type for which the method with this attribute \
166+
The type for which the method with this attribute
167167
implements a requirement.
168168
'''),
169169
Child('Comma', kind='CommaToken',
@@ -179,16 +179,16 @@
179179
]),
180180
Child('DeclNameArguments', kind='DeclNameArguments',
181181
is_optional=True, description='''
182-
The argument labels of the protocol\'s requirement if it \
182+
The argument labels of the protocol\'s requirement if it
183183
is a function requirement.
184184
'''),
185185
]),
186186

187187
# objc-selector-piece -> identifier? ':'?
188188
Node('ObjCSelectorPiece', kind='Syntax',
189189
description='''
190-
A piece of an Objective-C selector. Either consisiting of just an \
191-
identifier for a nullary selector, an identifier and a colon for a \
190+
A piece of an Objective-C selector. Either consisiting of just an
191+
identifier for a nullary selector, an identifier and a colon for a
192192
labeled argument or just a colon for an unlabeled argument
193193
''',
194194
children=[

utils/gyb_syntax_support/AvailabilityNodes.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# | availability-versioned-argument ','?
1414
Node('AvailabilityArgument', kind='Syntax',
1515
description='''
16-
A single argument to an `@available` argument like `*`, `iOS 10.1`, \
16+
A single argument to an `@available` argument like `*`, `iOS 10.1`,
1717
or `message: "This has been deprecated"`.
1818
''',
1919
children=[
@@ -31,7 +31,7 @@
3131
]),
3232
Child('TrailingComma', kind='CommaToken', is_optional=True,
3333
description='''
34-
A trailing comma if the argument is followed by another \
34+
A trailing comma if the argument is followed by another
3535
argument
3636
'''),
3737
]),
@@ -40,7 +40,7 @@
4040
# availability-versioned-argument -> identifier ':' version-tuple
4141
Node('AvailabilityLabeledArgument', kind='Syntax',
4242
description='''
43-
A argument to an `@available` attribute that consists of a label and \
43+
A argument to an `@available` attribute that consists of a label and
4444
a value, e.g. `message: "This has been deprecated"`.
4545
''',
4646
children=[
@@ -59,15 +59,15 @@
5959
# availability-version-restriction -> identifier version-tuple
6060
Node('AvailabilityVersionRestriction', kind='Syntax',
6161
description='''
62-
An argument to `@available` that restricts the availability on a \
62+
An argument to `@available` that restricts the availability on a
6363
certain platform to a version, e.g. `iOS 10` or `swift 3.4`.
6464
''',
6565
children=[
6666
Child('Platform', kind='IdentifierToken',
6767
classification='Keyword',
6868
description='''
69-
The name of the OS on which the availability should be \
70-
restricted or 'swift' if the availability should be \
69+
The name of the OS on which the availability should be
70+
restricted or 'swift' if the availability should be
7171
restricted based on a Swift version.
7272
'''),
7373
Child('Version', kind='VersionTuple'),
@@ -78,7 +78,7 @@
7878
# | float-literal '.' integer-literal
7979
Node('VersionTuple', kind='Syntax',
8080
description='''
81-
A version number of the form major.minor.patch in which the minor \
81+
A version number of the form major.minor.patch in which the minor
8282
and patch part may be ommited.
8383
''',
8484
children=[
@@ -87,15 +87,15 @@
8787
Child('Major', kind='IntegerLiteralToken'),
8888
Child('MajorMinor', kind='FloatingLiteralToken')
8989
], description='''
90-
In case the version consists only of the major version, an \
91-
integer literal that specifies the major version. In case \
92-
the version consists of major and minor version number, a \
93-
floating literal in which the decimal part is interpreted \
90+
In case the version consists only of the major version, an
91+
integer literal that specifies the major version. In case
92+
the version consists of major and minor version number, a
93+
floating literal in which the decimal part is interpreted
9494
as the minor version.
9595
'''),
9696
Child('PatchPeriod', kind='PeriodToken', is_optional=True,
9797
description='''
98-
If the version contains a patch number, the period \
98+
If the version contains a patch number, the period
9999
separating the minor from the patch number.
100100
'''),
101101
Child('PatchVersion', kind='IntegerLiteralToken',

utils/gyb_syntax_support/DeclNodes.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
# ('#if' | '#elseif' | '#else') expr? (stmt-list | switch-case-list)
9090
Node('IfConfigClause', kind='Syntax',
9191
children=[
92-
Child('PoundKeyword', kind='Token',
92+
Child('PoundKeyword', kind='Token',
9393
classification='BuildConfigId',
9494
token_choices=[
9595
'PoundIfToken',
@@ -115,7 +115,7 @@
115115
children=[
116116
Child('Clauses', kind='IfConfigClauseList',
117117
collection_element_name='Clause'),
118-
Child('PoundEndif', kind='PoundEndifToken',
118+
Child('PoundEndif', kind='PoundEndifToken',
119119
classification='BuildConfigId'),
120120
]),
121121

@@ -137,7 +137,7 @@
137137
Child('RightParen', kind='RightParenToken')
138138
]),
139139

140-
Node('PoundSourceLocation', kind='Decl',
140+
Node('PoundSourceLocation', kind='Decl',
141141
traits=['Parenthesized'],
142142
children=[
143143
Child('PoundSourceLocation', kind='PoundSourceLocationToken'),
@@ -148,12 +148,12 @@
148148

149149
Node('PoundSourceLocationArgs', kind='Syntax',
150150
children=[
151-
Child('FileArgLabel', kind='IdentifierToken',
151+
Child('FileArgLabel', kind='IdentifierToken',
152152
text_choices=['file']),
153153
Child('FileArgColon', kind='ColonToken'),
154154
Child('FileName', kind='StringLiteralToken'),
155155
Child('Comma', kind='CommaToken'),
156-
Child('LineArgLabel', kind='IdentifierToken',
156+
Child('LineArgLabel', kind='IdentifierToken',
157157
text_choices=['line']),
158158
Child('LineArgColon', kind='ColonToken'),
159159
Child('LineNumber', kind='IntegerLiteralToken'),
@@ -294,11 +294,11 @@
294294
# member-decl = decl ';'?
295295
Node('MemberDeclListItem', kind='Syntax', omit_when_empty=True,
296296
description='''
297-
A member declaration of a type consisting of a declaration and an \
297+
A member declaration of a type consisting of a declaration and an
298298
optional semicolon;
299299
''',
300300
children=[
301-
Child('Decl', kind='Decl',
301+
Child('Decl', kind='Decl',
302302
description='The declaration of the type member.'),
303303
Child('Semicolon', kind='SemicolonToken', is_optional=True,
304304
description='An optional trailing semicolon.'),
@@ -518,11 +518,11 @@
518518
Child('Modifier', kind='DeclModifier', is_optional=True),
519519
Child('AccessorKind', kind='Token',
520520
text_choices=[
521-
'get', 'set', 'didSet', 'willSet', 'unsafeAddress',
522-
'addressWithOwner', 'addressWithNativeOwner',
523-
'unsafeMutableAddress',
524-
'mutableAddressWithOwner',
525-
'mutableAddressWithNativeOwner',
521+
'get', 'set', 'didSet', 'willSet', 'unsafeAddress',
522+
'addressWithOwner', 'addressWithNativeOwner',
523+
'unsafeMutableAddress',
524+
'mutableAddressWithOwner',
525+
'mutableAddressWithNativeOwner',
526526
'_read', '_modify'
527527
]),
528528
Child('Parameter', kind='AccessorParameter', is_optional=True),
@@ -572,7 +572,7 @@
572572

573573
Node('EnumCaseElement', kind='Syntax',
574574
description='''
575-
An element of an enum case, containing the name of the case and, \
575+
An element of an enum case, containing the name of the case and,
576576
optionally, either associated values or an assignment to a raw value.
577577
''',
578578
traits=['WithTrailingComma'],
@@ -587,7 +587,7 @@
587587
'''),
588588
Child('TrailingComma', kind='CommaToken', is_optional=True,
589589
description='''
590-
The trailing comma of this element, if the case has \
590+
The trailing comma of this element, if the case has
591591
multiple elements.
592592
'''),
593593
]),
@@ -598,7 +598,7 @@
598598

599599
Node('EnumCaseDecl', kind='Decl',
600600
description='''
601-
A `case` declaration of a Swift `enum`. It can have 1 or more \
601+
A `case` declaration of a Swift `enum`. It can have 1 or more
602602
`EnumCaseElement`s inside, each declaring a different case of the
603603
enum.
604604
''',
@@ -649,13 +649,13 @@
649649
Child('InheritanceClause', kind='TypeInheritanceClause',
650650
is_optional=True,
651651
description='''
652-
The inheritance clause describing conformances or raw \
652+
The inheritance clause describing conformances or raw
653653
values for this enum.
654654
'''),
655655
Child('GenericWhereClause', kind='GenericWhereClause',
656656
is_optional=True,
657657
description='''
658-
The `where` clause that applies to the generic parameters of \
658+
The `where` clause that applies to the generic parameters of
659659
this enum.
660660
'''),
661661
Child('Members', kind='MemberDeclBlock',
@@ -664,7 +664,7 @@
664664
''')
665665
]),
666666

667-
# operator-decl -> attribute? modifiers? 'operator' operator
667+
# operator-decl -> attribute? modifiers? 'operator' operator
668668
Node('OperatorDecl', kind='Decl', traits=['IdentifiedDecl'],
669669
description='A Swift `operator` declaration.',
670670
children=[
@@ -762,7 +762,7 @@
762762
groups.
763763
''',
764764
children=[
765-
Child('HigherThanOrLowerThan', kind='IdentifierToken',
765+
Child('HigherThanOrLowerThan', kind='IdentifierToken',
766766
classification='Keyword',
767767
text_choices=[
768768
'higherThan', 'lowerThan',
@@ -823,7 +823,7 @@
823823
are grouped together in the absence of grouping parentheses.
824824
''',
825825
children=[
826-
Child('AssociativityKeyword', kind='IdentifierToken',
826+
Child('AssociativityKeyword', kind='IdentifierToken',
827827
classification='Keyword', text_choices=['associativity']),
828828
Child('Colon', kind='ColonToken'),
829829
Child('Value', kind='IdentifierToken',

0 commit comments

Comments
 (0)