Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Added exception handling. Fixed some problems with casting. Added STR…
… global function for converting a Lua string to see.base.String.
- Loading branch information
James King
committed
Aug 5, 2013
1 parent
87489ab
commit 48372af
Showing
11 changed files
with
259 additions
and
60 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| see | ||
| === | ||
|
|
||
| An API, library, and runtime environment all in on for ComputerCraft. | ||
| An object oriented environment for ComputerCraft. |
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,10 @@ | ||
| --@import see.base.String | ||
|
|
||
| --[[ | ||
| Constructs a new Exception. | ||
| @param string:message The error message. | ||
| ]] | ||
| function Exception:init(message) | ||
| message = cast(message, String) | ||
| self.message = message | ||
| end |
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
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,10 @@ | ||
| --@extends see.base.Exception | ||
|
|
||
| --[[ | ||
| Constructs a new RuntimeException. | ||
| @param string:message The error message. | ||
| ]] | ||
| function RuntimeException:init(message) | ||
| message = cast(message, String) | ||
| Exception.init(self, message) | ||
| end |
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,11 @@ | ||
| function Math.sin(x) | ||
| -- body | ||
| end | ||
|
|
||
| function Math.cos(x) | ||
| -- body | ||
| end | ||
|
|
||
| function Math.tan( ... ) | ||
| -- body | ||
| end |
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,8 @@ | ||
| function Test.main(args) | ||
| try (function() | ||
| System.print("Running some error-prone code...") | ||
| notarealfunction() | ||
| end, function(e) | ||
| System.print(STR"There was an exception! " .. e.message) | ||
| end) | ||
| end |
Oops, something went wrong.