-
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.
Fix formatting of class member functions
- Loading branch information
1 parent
c79ac50
commit 1c937ed
Showing
9 changed files
with
125 additions
and
3 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
1 change: 1 addition & 0 deletions
1
.../ballerina-parser/src/test/resources/declarations/service-decl/service_decl_source_23.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,6 +1,7 @@ | ||
service / on new http:Listener(8080) { | ||
resource function get /hello(string name) { | ||
} | ||
|
||
resource function get hello/(string name) { | ||
} | ||
} |
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
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ class Foo { | |
function getName() { | ||
|
||
} | ||
|
||
remote function get() { | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...c/test/resources/declarations/class-definition/assert/class_definition_declaration_18.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,17 @@ | ||
class Student { | ||
string name; | ||
int age; | ||
|
||
public function init(string name, int age) { | ||
self.name = name; | ||
self.age = age; | ||
} | ||
|
||
public function getName() returns string { | ||
return self.name; | ||
} | ||
|
||
public function getAge() returns int { | ||
return self.age; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -14,5 +14,6 @@ class Person { | |
string b = "bar"; | ||
return b; | ||
} | ||
|
||
string month = "february"; | ||
} |
15 changes: 15 additions & 0 deletions
15
...c/test/resources/declarations/class-definition/source/class_definition_declaration_18.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,15 @@ | ||
class Student { | ||
string name; | ||
int age; | ||
|
||
public function init(string name, int age) { | ||
self.name = name; | ||
self.age = age; | ||
} | ||
public function getName() returns string { | ||
return self.name; | ||
} | ||
public function getAge() returns int { | ||
return self.age; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...rc/test/resources/declarations/service-listener/assert/service_listener_declaration_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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import ballerina/http; | ||
|
||
public type Student readonly & record { | ||
string name; | ||
int age; | ||
}; | ||
|
||
http:Listener httpListener = check new (9090); | ||
|
||
public service class StudentService { | ||
*http:Service; | ||
|
||
Student[] students = []; | ||
|
||
resource function get students() returns Student[] { | ||
return self.students; | ||
} | ||
|
||
resource function post student(Student student) { | ||
self.students.push(student); | ||
} | ||
|
||
resource function post students(Student[] students) { | ||
self.students.push(...students); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...rc/test/resources/declarations/service-listener/source/service_listener_declaration_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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import ballerina/http; | ||
|
||
public type Student readonly & record { | ||
string name; | ||
int age; | ||
}; | ||
|
||
http:Listener httpListener = check new (9090); | ||
|
||
public service class StudentService { | ||
*http:Service; | ||
|
||
Student[] students = []; | ||
|
||
resource function get students() returns Student[] { | ||
return self.students; | ||
} | ||
resource function post student(Student student) { | ||
self.students.push(student); | ||
} | ||
resource function post students(Student[] students) { | ||
self.students.push(...students); | ||
} | ||
} |