-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add return type support and enhance parameter parsing
- Loading branch information
1 parent
5815bf4
commit db18673
Showing
9 changed files
with
145 additions
and
12 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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
MODULE | ||
FN | ||
FUN_KW: "fun" | ||
IDENT | ||
NAME: "foo" | ||
PARAM_LIST | ||
LEFT_PAREN: "(" | ||
RIGHT_PAREN: ")" | ||
STMT_LIST | ||
LEFT_BRACE: "{" | ||
RIGHT_BRACE: "}" | ||
FN | ||
FUN_KW: "fun" | ||
IDENT | ||
NAME: "bar" | ||
PARAM_LIST | ||
LEFT_PAREN: "(" | ||
RIGHT_PAREN: ")" | ||
RETURN_TYPE | ||
COLON: ":" | ||
PATH_TYPE | ||
NAME: "u32" | ||
STMT_LIST | ||
LEFT_BRACE: "{" | ||
RIGHT_BRACE: "}" | ||
|
||
Errors: |
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,2 @@ | ||
fun foo() {} | ||
fun bar(): u32 {} |
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,35 @@ | ||
MODULE | ||
FN | ||
FUN_KW: "fun" | ||
IDENT | ||
NAME: "f" | ||
PARAM_LIST | ||
LEFT_PAREN: "(" | ||
PARAM | ||
IDENT | ||
NAME: "x" | ||
PARAM | ||
IDENT | ||
NAME: "y" | ||
COLON: ":" | ||
PATH_TYPE | ||
NAME: "i32" | ||
COMMA: "," | ||
PARAM | ||
IDENT | ||
NAME: "z" | ||
COMMA: "," | ||
PARAM | ||
IDENT | ||
NAME: "t" | ||
COLON: ":" | ||
PATH_TYPE | ||
NAME: "i32" | ||
RIGHT_PAREN: ")" | ||
STMT_LIST | ||
LEFT_BRACE: "{" | ||
RIGHT_BRACE: "}" | ||
|
||
Errors: | ||
missing type for function parameter | ||
missing type for function parameter |
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 @@ | ||
fun f(x y: i32, z, t: i32) {} |
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,46 @@ | ||
MODULE | ||
FN | ||
FUN_KW: "fun" | ||
IDENT | ||
NAME: "a" | ||
PARAM_LIST | ||
LEFT_PAREN: "(" | ||
RIGHT_PAREN: ")" | ||
STMT_LIST | ||
LEFT_BRACE: "{" | ||
RIGHT_BRACE: "}" | ||
FN | ||
FUN_KW: "fun" | ||
IDENT | ||
NAME: "b" | ||
PARAM_LIST | ||
LEFT_PAREN: "(" | ||
PARAM | ||
IDENT | ||
NAME: "x" | ||
COLON: ":" | ||
PATH_TYPE | ||
NAME: "i32" | ||
RIGHT_PAREN: ")" | ||
STMT_LIST | ||
LEFT_BRACE: "{" | ||
RIGHT_BRACE: "}" | ||
FN | ||
FUN_KW: "fun" | ||
IDENT | ||
NAME: "c" | ||
PARAM_LIST | ||
LEFT_PAREN: "(" | ||
PARAM | ||
IDENT | ||
NAME: "x" | ||
COLON: ":" | ||
PATH_TYPE | ||
NAME: "i32" | ||
COMMA: "," | ||
RIGHT_PAREN: ")" | ||
STMT_LIST | ||
LEFT_BRACE: "{" | ||
RIGHT_BRACE: "}" | ||
|
||
Errors: |
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,3 @@ | ||
fun a() {} | ||
fun b(x: i32) {} | ||
fun c(x: i32, ) {} |
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 |
---|---|---|
|
@@ -40,6 +40,7 @@ pub enum SyntaxKind { | |
EXPR_STMT, | ||
FIELD_EXPR, | ||
FN, | ||
RETURN_TYPE, | ||
IDENT, | ||
TYPE_PARAM, | ||
LITERAL, | ||
|