-
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.
test(ast):
var
and const
declaration
Co-authored-by: Samyak S Sarnayak <samyak201@gmail.com>
- Loading branch information
Showing
32 changed files
with
3,811 additions
and
403 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
func abc() { | ||
var a = 10; | ||
var z int = 10; | ||
var ( | ||
b = 10; | ||
c int = 20; | ||
c, d, e int = 30, 40, 50; | ||
i, j, k = 50, 60, 70; | ||
); | ||
|
||
const a = 10; | ||
const i int = 10; | ||
const ( | ||
b = 10; | ||
c int = 20; | ||
c, d, e int = 30, 40, 50; | ||
i, j, k = 50, 60, 70; | ||
); | ||
|
||
}; |
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
func abc() { | ||
var a = 10; | ||
var ( | ||
c int = 20; | ||
f, g, h = 40; | ||
); | ||
}; |
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,7 @@ | ||
func abc() { | ||
var a = 10; | ||
var ( | ||
c int = 20; | ||
i, j, k int = 60, 70; | ||
); | ||
}; |
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,7 @@ | ||
func abc() { | ||
var a = 10; | ||
var ( | ||
c int = 20; | ||
i, j, k int = 10, 20, 30, 40; | ||
); | ||
}; |
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,8 @@ | ||
func abc() { | ||
const a = 10; | ||
const a int = 10; | ||
const ( | ||
c int = 20; | ||
i, j, k int = 10, 20, 30, 40; | ||
); | ||
}; |
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,6 @@ | ||
func abc() { | ||
const ( | ||
c int = 20; | ||
i, j, k = 60, 70; | ||
); | ||
}; |
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,7 @@ | ||
func abc() { | ||
const a = 10; | ||
const ( | ||
c int = 20; | ||
i, j, k int = 10, 20, 30, 40; | ||
); | ||
}; |
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
File renamed without changes.
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
14 changes: 14 additions & 0 deletions
14
compiler/tests/snapshots/parser__ast_from_path@02_var_decl.bakugo.snap
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,14 @@ | ||
--- | ||
source: tests/parser.rs | ||
expression: BakugoParsingErrDebug(err) | ||
input_file: tests/examples/ast_error/02_var_decl.bakugo | ||
--- | ||
× Parsing error | ||
╭─[02_var_decl.bakugo:4:1] | ||
4 │ c int = 20; | ||
5 │ f, g, h = 40; | ||
· ──────┬───── | ||
· ╰── Syntax error: Number of expressions (1) does not match number of identifers (3) | ||
6 │ ); | ||
╰──── | ||
|
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
14 changes: 14 additions & 0 deletions
14
compiler/tests/snapshots/parser__ast_from_path@03_var_decl.bakugo.snap
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,14 @@ | ||
--- | ||
source: tests/parser.rs | ||
expression: BakugoParsingErrDebug(err) | ||
input_file: tests/examples/ast_error/03_var_decl.bakugo | ||
--- | ||
× Parsing error | ||
╭─[03_var_decl.bakugo:4:1] | ||
4 │ c int = 20; | ||
5 │ i, j, k int = 60, 70; | ||
· ──────────┬───────── | ||
· ╰── Syntax error: Number of expressions (2) does not match number of identifers (3) | ||
6 │ ); | ||
╰──── | ||
|
Oops, something went wrong.