SmalltalkCodeGeneratorTool.st
branchjv
changeset 16408 bc62fb9a8df6
parent 16369 1090224cc0db
parent 16393 50c131b059ec
child 16445 6bc184e74f9c
--- a/SmalltalkCodeGeneratorTool.st	Tue May 03 06:42:52 2016 +0200
+++ b/SmalltalkCodeGeneratorTool.st	Wed May 04 06:51:10 2016 +0200
@@ -259,24 +259,24 @@
 !SmalltalkCodeGeneratorTool class methodsFor:'compilation'!
 
 compile:theCode forClass:aClass inCategory:cat
-    "install some code for a class.
+    "install some code for a class. Return the new method or nil.
      If refactory browser stuff is avaliable the refactory tools are used to support undo"
 
-    | parser |
+    | parser selector |
 
     super compile:theCode forClass:aClass inCategory:cat.
+
     parser := Parser parseMethodSpecification: theCode in: aClass ignoreErrors: true ignoreWarnings: true.
-    ^ parser selector notNil ifTrue:[
-        aClass compiledMethodAt: parser selector.
-    ] ifFalse:[ 
-        nil
+    (selector := parser selector notNil) ifTrue:[
+        ^ aClass compiledMethodAt: selector.
     ].
+    ^ nil
 
     "Created: / 05-08-2014 / 16:14:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 compile:theCode forClass:aClass inCategory:cat notifying: requestor
-    "install some code for a class.
+    "install some code for a class. Return the new method or nil.
      If refactory browser stuff is avaliable the refactory tools are used to support undo"
 
     CompilationErrorHandlerQuery