Skip to content

Commit b3d5f76

Browse files
committed
chore: adjust modifier pos
- gen pub -> pub gen - async pub -> pub async
1 parent 9c09da2 commit b3d5f76

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

planglib/std/cols/arr.pi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl <T> Array<T> {
5252
return;
5353
}
5454

55-
gen pub fn iter() Iterator<T> {
55+
pub gen fn iter() Iterator<T> {
5656
for let i = 0; i < self.len as i64; i = i + 1 {
5757
yield return self.data[i];
5858
}

planglib/std/cols/hashtable.pi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl <K:Hash+Eq<K>|V> HashTable<K|V> {
4242
}
4343
return;
4444
}
45-
gen pub fn into_iter() Iterator<(K,V)> {
45+
pub gen fn into_iter() Iterator<(K,V)> {
4646
for let i = 0; i < arr_len(self.buckets); i = i + 1 {
4747
let node = self.buckets[i];
4848
while node is *TableNode<K|V> {

src/nomparser/function.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use super::*;
1616
#[test_parser(
1717
"
1818
/// this is a comment
19-
gen pub fn f( x: int, y : int ) int {
19+
pub gen fn f( x: int, y : int ) int {
2020
x = x+1;
2121
return 0;
2222
}
@@ -25,14 +25,14 @@ use super::*;
2525
#[test_parser(
2626
"
2727
/// this is a comment
28-
async pub fn f( x: int, y : int ) int {
28+
pub async fn f( x: int, y : int ) int {
2929
x = x+1;
3030
return 0;
3131
}
3232
"
3333
)]
3434
#[test_parser(
35-
"gen pub fn f( x: int, y : int ) int {
35+
"pub gen fn f( x: int, y : int ) int {
3636
x = x+1;
3737
return 0;
3838
}
@@ -79,11 +79,14 @@ pub fn function_def(input: Span) -> IResult<Span, Box<TopLevel>> {
7979
map_res(
8080
tuple((
8181
many0(del_newline_or_space!(comment)),
82-
opt(alt((
83-
tag_token_word(TokenType::GENERATOR_MARKER),
84-
tag_token_word(TokenType::ASYNC_MARKER),
85-
))),
86-
modifiable(tag_token_word(TokenType::FN), TokenType::PUB),
82+
modifiable(
83+
opt(alt((
84+
tag_token_word(TokenType::GENERATOR_MARKER),
85+
tag_token_word(TokenType::ASYNC_MARKER),
86+
))),
87+
TokenType::PUB,
88+
),
89+
tag_token_word(TokenType::FN),
8790
identifier,
8891
opt(generic_type_def),
8992
tag_token_symbol(TokenType::LPAREN),
@@ -109,8 +112,8 @@ pub fn function_def(input: Span) -> IResult<Span, Box<TopLevel>> {
109112
)),
110113
|(
111114
doc,
112-
g,
113-
(modifier, (_, start)),
115+
(modifier, g),
116+
(_, start),
114117
function_identifier,
115118
generics,
116119
_,

test/test/std_test.pi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub fn test_std() void {
107107
return;
108108
}
109109

110-
async pub fn test_nested_async_closure() Task<()> {
110+
pub async fn test_nested_async_closure() Task<()> {
111111
let a = 1;
112112
let f =async || => {
113113
let f =async || => {

0 commit comments

Comments
 (0)