This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into enhancements/persistent-v2
- Loading branch information
Showing
7 changed files
with
75 additions
and
23 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
37 changes: 37 additions & 0 deletions
37
jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/decorator_stack.jac
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,37 @@ | ||
can star(func: Any) { | ||
can inner(x: Any) { | ||
print(("*" * 30)); | ||
func(x); | ||
print(("*" * 30)); | ||
} | ||
return inner; | ||
} | ||
|
||
can percent(func: Any) { | ||
can inner(y: Any) { | ||
print(("%" * 30)); | ||
func(y); | ||
print(("%" * 30)); | ||
} | ||
return inner; | ||
} | ||
|
||
can percent2(func: Any) { | ||
can inner(y: Any) { | ||
print(("-" * 30)); | ||
func(y); | ||
print(("+" * 30)); | ||
} | ||
return inner; | ||
} | ||
|
||
@star | ||
@percent | ||
@percent2 | ||
can printer(msg: Any) { | ||
print(msg); | ||
} | ||
|
||
with entry { | ||
printer("Hello"); | ||
} |
6 changes: 6 additions & 0 deletions
6
jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/triple_quoted_string.jac
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 @@ | ||
with entry { | ||
triple_quoted_string = """This is a triple quoted string. | ||
It can span multiple lines. | ||
It can contain any number of quotes or apostrophes. | ||
"""; | ||
} |
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,26 +1,27 @@ | ||
import:py re; | ||
|
||
glob a: int=5; | ||
glob a: int = 5; | ||
|
||
with entry { | ||
arguments = {x:None for x in re.findall(r'\{([A-Za-z0-9_]+)\}', "Apple {apple} pineapple {pineapple}")}; | ||
a: int=5; | ||
arguments = {x: None for x in re.findall( | ||
r'\{([A-Za-z0-9_]+)\}', | ||
"Apple {apple} pineapple {pineapple}" | ||
)}; | ||
a: int = 5; | ||
if False { | ||
with open(f"Apple{apple}.txt") as f { # Fix syntax highlighting | ||
|
||
print(f.read()); | ||
} | ||
} | ||
print(arguments); | ||
print( | ||
"""This is a long | ||
line of code.""" | ||
); | ||
print("""This is a long | ||
line of code."""); | ||
} | ||
|
||
with entry{ | ||
a={"a":"apple", "b":"ball", "c":"cat"}; | ||
y={**a, "d":"dog", "e":"elephant"}; | ||
with entry { | ||
a = {"a": "apple", "b": "ball", "c": "cat"}; | ||
y = {**a, "d": "dog", "e": "elephant"}; | ||
print(y); | ||
} | ||
# Use before def error would be nice |
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