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 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #566 from Jaseci-Labs/line_spacing
Formatter: Manage Line Spacing
- Loading branch information
Showing
3 changed files
with
93 additions
and
34 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
50 changes: 50 additions & 0 deletions
50
jaclang/compiler/passes/tool/tests/fixtures/general_format_checks/line_spacing.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,50 @@ | ||
import:py math; | ||
|
||
glob RAD = 5; | ||
glob DIA = 10; | ||
|
||
walker decorator_walk { | ||
can hash(func: Any) { | ||
can inner(a: Any) { | ||
print(("#" * 20)); | ||
func(a); | ||
print(("#" * 20)); | ||
} | ||
return inner; | ||
} | ||
|
||
can exclaim(func: Any) { | ||
can inner(b: Any) { | ||
print(("!" * 20)); | ||
func(b); | ||
print(("!" * 20)); | ||
} | ||
return inner; | ||
} | ||
|
||
can tilde(func: Any) { | ||
can inner(c: Any) { | ||
print(("~" * 20)); | ||
func(c); | ||
print(("~" * 20)); | ||
} | ||
return inner; | ||
} | ||
|
||
can greeter(name: Any) { | ||
print("Hello, " + name + "!"); | ||
} | ||
|
||
# Entry point for the walker | ||
can start with entry { | ||
# Apply decorators to greeter | ||
decorated_greeter = hash(exclaim(tilde(greeter))); | ||
|
||
# Call the decorated greeter function | ||
decorated_greeter("World"); | ||
} | ||
} | ||
|
||
with entry { | ||
root spawn decorator_walk(); | ||
} |
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