-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48b6315
commit e14e509
Showing
3 changed files
with
80 additions
and
7 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,64 @@ | ||
""" | ||
This test file is to ensure the valid syntax of jac lang. | ||
Add new jac syntax here to test if it compile without any issue. | ||
""" | ||
|
||
# Import statement without trailing comma. | ||
import:py from time { | ||
sleep, | ||
timezone, | ||
tzname | ||
} | ||
|
||
|
||
# Import statement with trailing comma. | ||
import:py from os { | ||
path, | ||
getenv, | ||
getpid, | ||
} | ||
|
||
|
||
enum WithoutTrailComma { | ||
FOO = "FOO", | ||
BAR = "BAR" | ||
} | ||
|
||
|
||
enum WithTrailComma { | ||
FOO = "FOO", | ||
BAR = "BAR", | ||
} | ||
|
||
|
||
can without_trail_comma(a:int, b:int) {} | ||
|
||
can with_trail_comma( | ||
a:int, | ||
b:int, | ||
c:int, | ||
) {} | ||
|
||
|
||
with entry { | ||
|
||
dict_without_trail_comma = { "key" : "value" }; | ||
dict_with_trail_comma = { | ||
"key" : "val", | ||
}; | ||
|
||
list_without_trail_comma = [ "foo", "bar" ]; | ||
list_with_trail_comma = [ | ||
"foo", | ||
"bar", | ||
]; | ||
|
||
set_without_trail_comma = { "foo", "bar" }; | ||
set_with_trail_comma = { | ||
"foo", | ||
"bar", | ||
}; | ||
|
||
print("Code compiled and ran successfully!"); | ||
} | ||
|
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