-
Notifications
You must be signed in to change notification settings - Fork 755
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update function call formatting with scoped args
- Loading branch information
1 parent
4f921a4
commit 1108daa
Showing
11 changed files
with
162 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...parser/src/test/resources/expressions/object-constructor/object_constructor_source_10.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
public function main() { | ||
foo(object { | ||
int i = 1; | ||
}); | ||
int i = 1; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...matter/modules/formatter-core/src/test/resources/misc/linebreaks/assert/line_breaks_3.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
public function foo() { | ||
( | ||
) y = () | ||
; | ||
; | ||
var x = (); | ||
|
||
int | ||
|
2 changes: 1 addition & 1 deletion
2
...matter/modules/formatter-core/src/test/resources/misc/linebreaks/assert/line_breaks_4.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
public function foo() { | ||
foreach string animal in animals { | ||
match | ||
animal | ||
animal | ||
{ | ||
"Mouse" => | ||
{ | ||
|
13 changes: 13 additions & 0 deletions
13
...ter/modules/formatter-core/src/test/resources/statements/call/assert/call_statement_4.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
type SourcePatient record { | ||
string message; | ||
string detail; | ||
string cause; | ||
}; | ||
|
||
function foo(string m, int c, int t, string d, string cause) { | ||
} | ||
|
||
function bar(SourcePatient sourcePatient, int errorCode, int errorType) { | ||
return foo(sourcePatient.message, errorCode, errorType, sourcePatient.detail, | ||
sourcePatient.cause); | ||
} |
32 changes: 32 additions & 0 deletions
32
...ter/modules/formatter-core/src/test/resources/statements/call/assert/call_statement_5.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
public function main() { | ||
foo(object { | ||
int i = 1; | ||
}, a, | ||
b); | ||
} | ||
|
||
public function bar() { | ||
bar(t1, object { | ||
int i = 1; | ||
}, t2, t3); | ||
} | ||
|
||
public function baz() { | ||
baz(t1, t2, object { | ||
int i = 1; | ||
int y = 2; | ||
}, | ||
b, | ||
c, | ||
d); | ||
} | ||
|
||
public function fox() { | ||
foz(t1, | ||
object { | ||
int i = 1; | ||
}, | ||
b, | ||
c, | ||
d); | ||
} |
21 changes: 21 additions & 0 deletions
21
...ter/modules/formatter-core/src/test/resources/statements/call/assert/call_statement_6.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function processEmployeeInfo(string firstName, string lastName, string department, string jobTitle, | ||
int employeeId, float salary) { | ||
} | ||
|
||
function foo() { | ||
string firstName = "John"; | ||
string lastName = "Doe"; | ||
string department = "Engineering"; | ||
string jobTitle = "Software Engineer"; | ||
int employeeId = 1001; | ||
float salary = 75000.0; | ||
|
||
processEmployeeInfo( | ||
firstName, | ||
lastName, | ||
department, | ||
jobTitle, | ||
employeeId, | ||
salary | ||
); | ||
} |
13 changes: 13 additions & 0 deletions
13
...ter/modules/formatter-core/src/test/resources/statements/call/source/call_statement_4.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
type SourcePatient record { | ||
string message; | ||
string detail; | ||
string cause; | ||
}; | ||
|
||
function foo(string m, int c, int t, string d, string cause) { | ||
} | ||
|
||
function bar(SourcePatient sourcePatient, int errorCode, int errorType) { | ||
return foo(sourcePatient.message, errorCode, errorType, sourcePatient.detail, | ||
sourcePatient.cause); | ||
} |
32 changes: 32 additions & 0 deletions
32
...ter/modules/formatter-core/src/test/resources/statements/call/source/call_statement_5.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
public function main() { | ||
foo(object { | ||
int i = 1; | ||
}, a, | ||
b); | ||
} | ||
|
||
public function bar() { | ||
bar(t1, object { | ||
int i = 1; | ||
}, t2, t3); | ||
} | ||
|
||
public function baz() { | ||
baz(t1, t2, object { | ||
int i = 1; | ||
int y = 2; | ||
}, | ||
b, | ||
c, | ||
d); | ||
} | ||
|
||
public function fox() { | ||
foz(t1, | ||
object { | ||
int i = 1; | ||
}, | ||
b, | ||
c, | ||
d); | ||
} |
21 changes: 21 additions & 0 deletions
21
...ter/modules/formatter-core/src/test/resources/statements/call/source/call_statement_6.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function processEmployeeInfo(string firstName, string lastName, string department, string jobTitle, | ||
int employeeId, float salary) { | ||
} | ||
|
||
function foo() { | ||
string firstName = "John"; | ||
string lastName = "Doe"; | ||
string department = "Engineering"; | ||
string jobTitle = "Software Engineer"; | ||
int employeeId = 1001; | ||
float salary = 75000.0; | ||
|
||
processEmployeeInfo( | ||
firstName, | ||
lastName, | ||
department, | ||
jobTitle, | ||
employeeId, | ||
salary | ||
); | ||
} |