ChangeSet.st
branchjv
changeset 4383 c6ff0a1dc213
parent 4330 998eb03f0736
child 4394 c5c365c76256
--- a/ChangeSet.st	Tue Nov 06 21:01:37 2018 +0000
+++ b/ChangeSet.st	Wed Nov 07 12:40:08 2018 +0000
@@ -39,7 +39,7 @@
 !
 
 ChangeSet::ChangeFileReader subclass:#BeeChangeFileReader
-	instanceVariableNames:''
+	instanceVariableNames:'properties'
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:ChangeSet
@@ -3810,6 +3810,22 @@
     "Created: / 27-02-2018 / 09:27:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+handleMethodDefinition
+    | source |
+
+    source := inputStream nextChunk.
+    self addChange:  
+        (MethodDefinitionChange new
+            className: (properties at: 'className:');
+            selector: (properties at: 'selector:');
+            source: source;
+            category: (properties at: 'category:');
+            yourself).
+    ^ true
+
+    "Created: / 06-11-2018 / 22:51:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 processChangeUnsafe
     "given a parse-tree (from parsing some changes source/chunk),
      create changes and evaluate changeAction on each.
@@ -3817,14 +3833,36 @@
      arg; the lineNumber is only valid, if the underlying stream
      provides line-numbers; otherwise, nil is passed."
 
-    |dispatchSelector|
-
-    dispatchSelector := ('process_',(selector copyReplaceAll:$: with:$_)) asSymbol.
+    | dispatchSelector |
+
+    dispatchSelector := ('process_',(selector copyReplaceAll:$: with:$_)) asSymbolIfInterned.
 "/ Transcript showCR:dispatchSelector.
-    (self respondsTo:dispatchSelector) ifTrue:[
+    (dispatchSelector notNil and:[self respondsTo:dispatchSelector]) ifTrue:[
         ^ self perform:dispatchSelector.
     ].
 
+    parseTree receiver isVariable ifTrue:[ 
+        dispatchSelector := ('handle', parseTree receiver name) asSymbol"IfInterned".
+        (dispatchSelector notNil and:[self respondsTo:dispatchSelector]) ifTrue:[
+            | change |
+
+            "/ Initialize properties dictionary...
+            properties := Dictionary new.
+            selector keywords withIndexDo:[ :property :index |
+                | value |
+
+                properties at: property put: (value := (parseTree arguments at: index) value).
+                (property = 'timestamp:') ifTrue:[ 
+                    timestamp := Timestamp fromString: value
+                ].  
+            ].
+            ^ self perform:dispatchSelector.
+        ] ifFalse:[ 
+            "/ uncomment following for debugging
+            self halt: 'Unknown change type: ', parseTree receiver name
+        ].
+    ].
+
     (parseTree receiver isVariable and:[ parseTree receiver name = 'MethodDefinition']) ifTrue:[ 
         ^ self handleMethodChange
     ].
@@ -3839,8 +3877,7 @@
     ^ false
 
     "Created: / 21-08-2014 / 18:37:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 26-02-2018 / 17:30:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 27-02-2018 / 09:26:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-11-2018 / 23:20:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 process_timeStamp_author_className_project_