Skip to content

Commit 72c41c7

Browse files
committed
Remove #assert token and syntax node
1 parent 8e9250e commit 72c41c7

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

Sources/SwiftParser/TokenPrecedence.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ public enum TokenPrecedence: Comparable {
144144
self = .weakBracketClose
145145

146146
// MARK: Statement keyword punctuator
147-
case // #error, #warning and #assert are statement-like
148-
.poundErrorKeyword, .poundWarningKeyword, .poundAssertKeyword:
147+
case // #error, #warning is statement-like
148+
.poundErrorKeyword, .poundWarningKeyword:
149149
self = .stmtKeyword
150150

151151
// MARK: Strong bracketet

gyb_syntax_support/StmtNodes.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -328,18 +328,4 @@
328328
collection_element_name='CatchItem', is_optional=True),
329329
Child('Body', kind='CodeBlock'),
330330
]),
331-
332-
# e.g. #assert(1 == 2)
333-
Node('PoundAssertStmt', name_for_diagnostics="'#assert' directive", kind='Stmt',
334-
children=[
335-
Child('PoundAssert', kind='PoundAssertToken'),
336-
Child('LeftParen', kind='LeftParenToken'),
337-
Child('Condition', kind='Expr', name_for_diagnostics='condition',
338-
description='The assertion condition.'),
339-
Child('Comma', kind='CommaToken', is_optional=True,
340-
description='The comma after the assertion condition.'),
341-
Child('Message', kind='StringLiteralExpr', name_for_diagnostics='message', is_optional=True,
342-
description='The assertion message.'),
343-
Child('RightParen', kind='RightParenToken'),
344-
]),
345331
]

gyb_syntax_support/Token.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,7 @@ def macro_name(self):
227227
Punctuator('MultilineStringQuote', 'multiline_string_quote',
228228
text='\\\"\\\"\\\"', classification='StringLiteral'),
229229

230-
PoundKeyword('PoundAssert', 'assert', text='#assert'),
231-
230+
# Keywords prefixed with a '#'.
232231
PoundDirectiveKeyword('PoundSourceLocation', 'sourceLocation',
233232
text='#sourceLocation'),
234233
PoundDirectiveKeyword('PoundWarning', 'warning', text='#warning'),

0 commit comments

Comments
 (0)