--- a/Smalltalk.st Thu Nov 03 21:32:59 2016 +0100
+++ b/Smalltalk.st Thu Nov 03 21:48:42 2016 +0100
@@ -4538,69 +4538,82 @@
process := [
self providingDisplayDo:[
- VerboseStartup == true ifTrue:[
- ('Smalltalk [info]: executing expression: "', arg, '".') infoPrintCR.
- ].
- UserInterrupt handle:[:ex |
- Debugging == true ifTrue:[
- 'user interrupt (type "c" to continue; "x" to exit; "?" for help).' errorPrintCR.
- "/ thisContext fullPrintAll.
- MiniDebugger enter.
- ex proceed.
- ].
- self exit:128+(OperatingSystem sigINT).
+ NoHandlerError handle:[:ex |
+ Debugging == true ifFalse:[
+ ObjectMemory debugPrinting ifTrue:[
+ ex description lowLevelErrorPrintCR.
+ Object infoPrinting ifTrue:[
+ ex suspendedContext fullPrintAll.
+ ].
+ ].
+ self exit:1
+ ].
+ ex reject.
] do:[
- isFilter ifTrue:[
- "/ --filter - apply code to each input line.
- "/ compile code only once
- Compiler
- compile:'doIt:line ',arg
- forClass:String
- notifying:(EvalScriptingErrorHandler new source:arg).
-
- [Stdin atEnd] whileFalse:[
- |line|
-
- line := Stdin nextLine.
- line doIt:line.
- ].
- ] ifFalse:[
- (isPrint | isEval) ifTrue:[
- "/ --print or --eval
- |rslt|
-
- rslt := Parser new
- evaluate:arg
- notifying:(EvalScriptingErrorHandler new source:arg)
- compile:true.
- isPrint ifTrue:[
- rslt printCR.
+ VerboseStartup == true ifTrue:[
+ ('Smalltalk [info]: executing expression: "', arg, '".') infoPrintCR.
+ ].
+ UserInterrupt handle:[:ex |
+ Debugging == true ifTrue:[
+ 'user interrupt (type "c" to continue; "x" to exit; "?" for help).' errorPrintCR.
+ "/ thisContext fullPrintAll.
+ MiniDebugger enter.
+ ex proceed.
+ ].
+ self exit:128+(OperatingSystem sigINT).
+ ] do:[
+ isFilter ifTrue:[
+ "/ --filter - apply code to each input line.
+ "/ compile code only once
+ Compiler
+ compile:'doIt:line ',arg
+ forClass:String
+ notifying:(EvalScriptingErrorHandler new source:arg).
+
+ [Stdin atEnd] whileFalse:[
+ |line|
+
+ line := Stdin nextLine.
+ line doIt:line.
].
] ifFalse:[
- "/ --run <className>
- |className class|
-
- className := arg.
- class := Smalltalk classNamed:className.
- class isNil ifTrue:[
- StandAlone := true.
- self exitWithErrorMessage:'no such class: "', className, '".'
- ].
- (class respondsTo:#main:) ifTrue:[
- class main:CommandLineArguments.
- ] ifFalse:[
- (class respondsTo:#main) ifTrue:[
- class main.
+ (isPrint | isEval) ifTrue:[
+ "/ --print or --eval
+ |rslt|
+
+ rslt := Parser new
+ evaluate:arg
+ notifying:(EvalScriptingErrorHandler new source:arg)
+ compile:true.
+ isPrint ifTrue:[
+ rslt printCR.
+ ].
+ ] ifFalse:[
+ "/ --run <className>
+ |className class|
+
+ className := arg.
+ class := Smalltalk classNamed:className.
+ class isNil ifTrue:[
+ StandAlone := true.
+ self exitWithErrorMessage:'no such class: "', className, '".'
+ ].
+ (class respondsTo:#main:) ifTrue:[
+ class main:CommandLineArguments.
] ifFalse:[
- (class respondsTo:#start) ifTrue:[
- class start.
+ (class respondsTo:#main) ifTrue:[
+ class main.
] ifFalse:[
- StandAlone := true.
- self exitWithErrorMessage:'class has no "main:", "main" or "start" method.'
+ (class respondsTo:#start) ifTrue:[
+ class start.
+ ] ifFalse:[
+ StandAlone := true.
+ self exitWithErrorMessage:'class has no "main:", "main" or "start" method.'
+ ].
].
].
].
- ].
+ ].
].
].
].