From 93872bd81dd496a56f869036ecb5d5dacd84c4ca Mon Sep 17 00:00:00 2001 From: "hyunghwan.chung" Date: Mon, 2 May 2016 13:59:28 +0000 Subject: [PATCH] redefined Apex>primitiveFailed --- stix/kernel/Apex.st | 11 ++++------- stix/kernel/Context.st | 14 ++++++++++++++ stix/kernel/test-011.st | 4 ++++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/stix/kernel/Apex.st b/stix/kernel/Apex.st index fccb956..e038ad8 100644 --- a/stix/kernel/Apex.st +++ b/stix/kernel/Apex.st @@ -219,13 +219,10 @@ ## ------------------------------------------------------- ## ------------------------------------------------------- - #method(#class) primitiveFailed - { - ## TODO: implement this - ## PrimitiveFailureError signal. - self dump. - 'primitive failed' dump. - } + ## #method(#class) primitiveFailed + ## { + ## this method will be added after Exception class has been defined. + ## } #method primitiveFailed { diff --git a/stix/kernel/Context.st b/stix/kernel/Context.st index a5335b4..e25426d 100644 --- a/stix/kernel/Context.st +++ b/stix/kernel/Context.st @@ -390,3 +390,17 @@ Processor activeProcess terminate. self signal: 'no such message'. } } + + +#extend Apex +{ + #method(#class) primitiveFailed + { + ## TODO: implement this + ## PrimitiveFailureError signal. + self dump. + ##'primitive failed' dump. +# TODO: define a specialized exception class for primitive failure and use it. + Exception signal: 'PRIMITIVE FAILED...'. + } +} diff --git a/stix/kernel/test-011.st b/stix/kernel/test-011.st index 6f88124..e9337d1 100644 --- a/stix/kernel/test-011.st +++ b/stix/kernel/test-011.st @@ -168,6 +168,10 @@ ## self test12. ##100 timesRepeat: ['>>>>> END OF MAIN' dump]. + + ## the following line(return:to:) must cause primitive failure... + ##[ Processor return: 10 to: 20. ] on: Exception do: [:ex | ex messageText dump]. + '>>>>> END OF MAIN' dump. } }