Skip to content

Commit

Permalink
FEAT: allow try to accept code as a paren!
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Jun 29, 2022
1 parent 6ac01e3 commit 9ea8105
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/boot/natives.reb
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ trace: native [

try: native [
{Tries to DO a block and returns its value or an error.}
block [block!]
block [block! paren!]
/except "On exception, evaluate this code block"
code [block! any-function!]
]
Expand Down
7 changes: 7 additions & 0 deletions src/tests/units/error-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ Rebol [

~~~start-file~~~ "ERROR"

===start-group=== "TRY"
--test-- "basic TRY"
--assert 2 = try [1 + 1]
--assert 2 = try first [(1 + 1)]
===end-group===


===start-group=== "make error!"
;@@ https://github.com/Oldes/Rebol-issues/issues/835
;@@ https://github.com/Oldes/Rebol-issues/issues/1593
Expand Down

0 comments on commit 9ea8105

Please sign in to comment.