- PeekableStream jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 31 Oct 2012 18:09:01 +0000
branchjv
changeset 17979 f7b926e73893
parent 17978 6b1b40d82694
child 17980 c455051f092a
- PeekableStream changed: #fileInNextChunkNotifying:passChunk:silent: - ClassCategoryReader changed: #fileInFrom:notifying:passChunk:single:silent:
ClassCategoryReader.st
PeekableStream.st
--- a/ClassCategoryReader.st	Wed Oct 31 17:49:25 2012 +0000
+++ b/ClassCategoryReader.st	Wed Oct 31 18:09:01 2012 +0000
@@ -326,6 +326,11 @@
                     (compiler respondsTo:#compile:forClass:inCategory:notifying:install:skipIfSame:silent:)
                     ifTrue:[
                         "/ ST/X's compiler
+
+                         "JV@2012-10-31: Here, we don't want to correct nor define
+                          undeclared variable, When a code is loaded from a Workspace,
+                          all not-yet-loaded classes in namespace would become
+                          Workspace variables which is wrong!!"
                         [
                             method := compiler
                                          compile:aString
@@ -386,6 +391,7 @@
     "Created: / 17-05-1998 / 19:56:32 / cg"
     "Modified: / 31-07-2011 / 09:30:07 / cg"
     "Modified: / 26-10-2012 / 12:55:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 31-10-2012 / 18:10:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 fileInFrom:aStream silent:beSilent
@@ -445,11 +451,11 @@
 !ClassCategoryReader class methodsFor:'documentation'!
 
 version
-    ^ '$Id: ClassCategoryReader.st 10856 2012-10-29 17:05:17Z vranyj1 $'
+    ^ '$Id: ClassCategoryReader.st 10861 2012-10-31 18:09:01Z vranyj1 $'
 !
 
 version_SVN
-    ^ '$Id: ClassCategoryReader.st 10856 2012-10-29 17:05:17Z vranyj1 $'
+    ^ '$Id: ClassCategoryReader.st 10861 2012-10-31 18:09:01Z vranyj1 $'
 ! !
 
 ClassCategoryReader initialize!
--- a/PeekableStream.st	Wed Oct 31 17:49:25 2012 +0000
+++ b/PeekableStream.st	Wed Oct 31 18:09:01 2012 +0000
@@ -569,17 +569,29 @@
             compiler allowUndeclaredVariables:false.
 
             sawExcla ifFalse:[
-                "/ class definition chunks, etc., which are simply evaluated
-                rslt := compiler evaluate:aString notifying:someone.
+                "JV@2012-10-31: Here, we don't want to correct nor define
+                 undeclared variable, When a code is loaded from a Workspace,
+                 all not-yet-loaded classes in namespace would become
+                 Workspace variables which is wrong!!"
+                [
+                    "/ class definition chunks, etc., which are simply evaluated
+                    rslt := compiler evaluate:aString notifying:someone.
+                ] on: Parser undefinedVariableNotification do:[:ex|
+                    ex proceedWith: false "No, do not correct!!"
+                ].
             ] ifTrue:[
                 "/ methodsFor chunks, etc., which generate a reader
                 Smalltalk::Compiler emptySourceNotificationSignal handle:[:ex |
                     ^ nil
                 ] do:[
-                    rslt := compiler 
-                                evaluate:aString 
-                                notifying:someone 
-                                compile:false.
+                    [
+                        rslt := compiler 
+                                    evaluate:aString 
+                                    notifying:someone 
+                                    compile:false.
+                    ] on: Parser undefinedVariableNotification do:[:ex|
+                        ex proceedWith: false "No, do not correct!!"
+                    ].
                 ].
 
                 "
@@ -612,6 +624,7 @@
     ^ rslt
 
     "Modified: / 05-02-2011 / 10:06:57 / cg"
+    "Modified: / 31-10-2012 / 18:09:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 fileInNotifying:notifiedLoader passChunk:passChunk
@@ -1034,7 +1047,7 @@
 !PeekableStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/PeekableStream.st,v 1.40 2011/02/05 10:40:33 cg Exp $'
+    ^ '$Id: PeekableStream.st 10861 2012-10-31 18:09:01Z vranyj1 $'
 !
 
 version_CVS
@@ -1042,10 +1055,7 @@
 !
 
 version_SVN
-    ^ '$Id: PeekableStream.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: PeekableStream.st 10861 2012-10-31 18:09:01Z vranyj1 $'
 ! !
 
 PeekableStream initialize!
-
-
-