--- 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.