mirror of
https://github.com/PeterCamilleri/fOOrth
synced 2024-11-16 07:47:56 +01:00
Removed the superflous ForceAbort exception.
This commit is contained in:
parent
36e55aaea3
commit
b4d8af4199
5 changed files with 2 additions and 10 deletions
|
@ -59,7 +59,7 @@ module XfOOrth
|
|||
elsif (value = word.to_foorth_n)
|
||||
token << "vm.push(#{value.foorth_embed}); "
|
||||
else
|
||||
abort("?#{word}?")
|
||||
error "?#{word}?"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -11,6 +11,4 @@ module XfOOrth
|
|||
#The exception raised to silently force the fOOrth language system to exit.
|
||||
class SilentExit < StandardError; end
|
||||
|
||||
#The exception raised to force the fOOrth language system to abort execution.
|
||||
class ForceAbort < StandardError; end
|
||||
end
|
|
@ -30,7 +30,7 @@ module XfOOrth
|
|||
rescue ZeroDivisionError
|
||||
vm.display_abort("Error: Division by zero.")
|
||||
|
||||
rescue XfOOrthError, ForceAbort => error
|
||||
rescue XfOOrthError => error
|
||||
vm.display_abort(error)
|
||||
end
|
||||
|
||||
|
|
|
@ -28,11 +28,6 @@ class Object
|
|||
fail XfOOrth::XfOOrthError, msg, caller
|
||||
end
|
||||
|
||||
#Raise an abort exception with message.
|
||||
def abort(msg)
|
||||
raise XfOOrth::ForceAbort, msg
|
||||
end
|
||||
|
||||
#Argument coercion methods. These are stubs.
|
||||
|
||||
#Coerce the argument to match my type. Stub
|
||||
|
|
|
@ -38,7 +38,6 @@ class ObjectMonkeyPatchTester < MiniTest::Unit::TestCase
|
|||
#Test the quick fail raise in fOOrth.
|
||||
def test_that_exceptions_are_easy_to_raise
|
||||
assert_raises(XfOOrth::XfOOrthError) { error('Failure IS an option!') }
|
||||
assert_raises(XfOOrth::ForceAbort) { abort('Aborting execution!') }
|
||||
end
|
||||
|
||||
def test_mnmx_gt
|
||||
|
|
Loading…
Reference in a new issue