-
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.
Showing
11 changed files
with
406 additions
and
81 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,48 @@ | ||
loc MAIN: | ||
// "local" x | ||
int x; | ||
|
||
// This sets the local x to 10 | ||
x = 10; | ||
// This sets the x in the namespace TEST to 20 | ||
TEST::x = 20; | ||
|
||
// Prints the Variables | ||
sub PRINT_VARS; | ||
|
||
// Sets the variables from inside the TEST namespace | ||
sub TEST::SET_X; | ||
print "CALLING TEST::SET_X...\n"; | ||
|
||
// Prints the changed Variables | ||
sub PRINT_VARS; | ||
|
||
// Done | ||
exit; | ||
|
||
|
||
sub PRINT_VARS: | ||
print "VARS:\n"; | ||
print "X: "; | ||
print x; | ||
print "\n"; | ||
|
||
print "TEST:X: "; | ||
print TEST::x; | ||
print "\n\n"; | ||
|
||
ret; | ||
|
||
|
||
|
||
namespace TEST | ||
{ | ||
int x; | ||
|
||
sub SET_X: | ||
x = 50; | ||
GLOBAL::x = 100; | ||
ret; | ||
|
||
// You can also have nested namespaces | ||
} |
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
Oops, something went wrong.