Merge jv
authorMerge Script
Tue, 01 Dec 2015 06:37:31 +0100
branchjv
changeset 3682 7225237d33a0
parent 3680 c4db156c1b9d (current diff)
parent 3681 4db107dbec8a (diff)
child 3684 36e0b926f016
Merge
ByteCodeCompiler.st
--- a/ByteCodeCompiler.st	Fri Nov 27 06:55:51 2015 +0100
+++ b/ByteCodeCompiler.st	Tue Dec 01 06:37:31 2015 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -432,6 +430,21 @@
 	Claus Gittinger
 
 "
+!
+
+examples
+"
+    a GNU-Smalltalk method:                                                                    
+                                                                        [exBegin]
+    Compiler 
+        compile:'bla
+    <category: ''tests''>
+
+    ^ 123
+'
+        forClass: Object
+                                                                        [exEnd]
+"
 ! !
 
 !ByteCodeCompiler class methodsFor:'initialization'!
@@ -3058,7 +3071,7 @@
 
     |newMethod tree symbolicCodeArray oldMethod silencio newSource primNr keptOldCode answer
      aClass sourceCodeString hasErrorInMethodHeader oldCategory newCategory oldPackage 
-     newPackage installSelector ns dialogText failureReason|
+     newPackage installSelector ns dialogText failureReason annotationCategory|
 
     aClass := aClassArg.
     sourceCodeString := sourceCodeStringArg.
@@ -3360,6 +3373,12 @@
         newSource := self class stringWithSimpleCRs:newSource
     ].
     newMethod source:newSource string.
+    (newMethod hasAnnotation: #'category:') ifTrue:[
+        annotationCategory := (newMethod annotationAt:#'category:') argumentAt:1.
+        annotationCategory isString ifTrue:[
+            newCategory := annotationCategory
+        ].
+    ].
     newMethod setCategory:newCategory.
     newMethod setPackage:newPackage.