File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -1210,6 +1210,38 @@ final class ExpressionTests: ParserTestCase {
12101210 assertParse ( " use(_borrow msg) " )
12111211 assertParse ( " _borrow msg " )
12121212 assertParse ( " let b = (_borrow self).buffer " )
1213+ assertParse ( " borrow msg " )
1214+ assertParse ( " use(borrow msg) " )
1215+ assertParse ( " borrow(msg) " )
1216+ assertParse ( " borrow (msg) " )
1217+ }
1218+
1219+ func testBorrowNameFunctionCallStructure1( ) {
1220+ assertParse (
1221+ """
1222+ borrow(msg)
1223+ """ ,
1224+ substructure: FunctionCallExprSyntax (
1225+ calledExpression: DeclReferenceExprSyntax ( baseName: . identifier( " borrow " ) ) ,
1226+ leftParen: . leftParenToken( ) ,
1227+ arguments: LabeledExprListSyntax ( [ LabeledExprSyntax ( expression: ExprSyntax ( " msg " ) ) ] ) ,
1228+ rightParen: . rightParenToken( )
1229+ )
1230+ )
1231+ }
1232+
1233+ func testBorrowNameFunctionCallStructure2( ) {
1234+ assertParse (
1235+ """
1236+ borrow (msg)
1237+ """ ,
1238+ substructure: FunctionCallExprSyntax (
1239+ calledExpression: DeclReferenceExprSyntax ( baseName: . identifier( " borrow " ) ) ,
1240+ leftParen: . leftParenToken( ) ,
1241+ arguments: LabeledExprListSyntax ( [ LabeledExprSyntax ( expression: ExprSyntax ( " msg " ) ) ] ) ,
1242+ rightParen: . rightParenToken( )
1243+ )
1244+ )
12131245 }
12141246
12151247 func testCodeCompletionExpressions( ) {
You can’t perform that action at this time.
0 commit comments