Parser.st
changeset 450 8ad79af3e91c
parent 448 cdbf95590e3d
child 451 9e116ffc172c
--- a/Parser.st	Thu Dec 12 14:38:06 1996 +0100
+++ b/Parser.st	Mon Dec 16 18:16:09 1996 +0100
@@ -1550,54 +1550,54 @@
     "block arguments"
     searchBlock := currentBlock.
     [searchBlock notNil] whileTrue:[
-	args := searchBlock arguments.
-	args notNil ifTrue:[
-	    args do:[:aBlockArg |
-		names add:(aBlockArg name).
-		dists add:(aString spellAgainst: "levenshteinTo:"(aBlockArg name))
-	    ]
-	].
-
-	vars := searchBlock variables.
-	vars notNil ifTrue:[
-	    vars do:[:aBlockVar |
-		names add:(aBlockVar name).
-		dists add:(aString spellAgainst: "levenshteinTo:"(aBlockVar name))
-	    ]
-	].
-	searchBlock := searchBlock home
+        args := searchBlock arguments.
+        args notNil ifTrue:[
+            args do:[:aBlockArg |
+                names add:(aBlockArg name).
+                dists add:(aString spellAgainst: "levenshteinTo:"(aBlockArg name))
+            ]
+        ].
+
+        vars := searchBlock variables.
+        vars notNil ifTrue:[
+            vars do:[:aBlockVar |
+                names add:(aBlockVar name).
+                dists add:(aString spellAgainst: "levenshteinTo:"(aBlockVar name))
+            ]
+        ].
+        searchBlock := searchBlock home
     ].
 
     "method-variables"
     methodVars notNil ifTrue:[
-	methodVarNames do:[:methodVarName |
-	    names add:methodVarName.
-	    dists add:(aString spellAgainst: "levenshteinTo:"methodVarName)
-	]
+        methodVarNames do:[:methodVarName |
+            names add:methodVarName.
+            dists add:(aString spellAgainst: "levenshteinTo:"methodVarName)
+        ]
     ].
 
     "method-arguments"
     methodArgs notNil ifTrue:[
-	methodArgNames do:[:methodArgName |
-	    names add:methodArgName.
-	    dists add:(aString spellAgainst: "levenshteinTo:"methodArgName)
-	]
+        methodArgNames do:[:methodArgName |
+            names add:methodArgName.
+            dists add:(aString spellAgainst: "levenshteinTo:"methodArgName)
+        ]
     ].
 
     "instance-variables"
     classToCompileFor notNil ifTrue:[
-	PrevInstVarNames do:[:instVarName |
-	    names add:instVarName.
-	    dists add:(aString spellAgainst: "levenshteinTo:"instVarName)
-	]
+        self classesInstVarNames do:[:instVarName |
+            names add:instVarName.
+            dists add:(aString spellAgainst: "levenshteinTo:"instVarName)
+        ]
     ].
 
     "class-variables"
     classToCompileFor notNil ifTrue:[
-	PrevClassVarNames do:[:classVarName |
-	    names add:classVarName.
-	    dists add:(aString spellAgainst: "levenshteinTo:"classVarName)
-	].
+        self classesClassVarNames do:[:classVarName |
+            names add:classVarName.
+            dists add:(aString spellAgainst: "levenshteinTo:"classVarName)
+        ].
 
 "/        aClass := classToCompileFor.
 "/        aClass isMeta ifTrue:[
@@ -1620,55 +1620,57 @@
 
     "globals"
     Smalltalk keysDo:[:aKey |
-	globalVarName := aKey asString.
-	"only compare strings where length is about right"
-	((globalVarName size - aString size) abs < 3) ifTrue:[
-	    names add:globalVarName.
-	    dists add:(aString spellAgainst: "levenshteinTo:"globalVarName)
-	]
+        globalVarName := aKey asString.
+        "only compare strings where length is about right"
+        ((globalVarName size - aString size) abs < 3) ifTrue:[
+            names add:globalVarName.
+            dists add:(aString spellAgainst: "levenshteinTo:"globalVarName)
+        ]
     ].
 
     "misc"
     #('self' 'super' 'nil' 'thisContext') do:[:name |
-	names add:name.
-	dists add:(aString spellAgainst: "levenshteinTo:"name)
+        names add:name.
+        dists add:(aString spellAgainst: "levenshteinTo:"name)
     ].
 
     (dists size ~~ 0) ifTrue:[
-	dists sortWith:names.
-	dists := dists reverse.             
-	names := names reverse.
-	n := names size min:10.
-	names := names copyTo:n.
-
-	"if it starts with a lower case character, add all local & instvar names"
-	(aString at:1) isLowercase ifTrue:[
-	    methodVarNames size > 0 ifTrue:[
-		names add:'---- method locals ----'.
-		methodVarNames asSortedCollection do:[:methodVarName |
-		    names add:methodVarName.
-		].
-	    ].
-
-
-	    methodArgs notNil ifTrue:[
-		names add:'---- method arguments ----'.
-		methodArgNames asSortedCollection do:[:methodArgName |
-		    names add:methodArgName.
-		]
-	    ].
-
-	    names add:'---- instance variables ----'.
-	    PrevInstVarNames asSortedCollection do:[:instVarName |
-		(names includes:instVarName) ifFalse:[
-		    names add:instVarName.
-		]
-	    ]
-	].
-
-	^ names
+        dists sortWith:names.
+        dists := dists reverse.             
+        names := names reverse.
+        n := names size min:10.
+        names := names copyTo:n.
+
+        "if it starts with a lower case character, add all local & instvar names"
+        (aString at:1) isLowercase ifTrue:[
+            methodVarNames size > 0 ifTrue:[
+                names add:'---- method locals ----'.
+                methodVarNames asSortedCollection do:[:methodVarName |
+                    names add:methodVarName.
+                ].
+            ].
+
+
+            methodArgs notNil ifTrue:[
+                names add:'---- method arguments ----'.
+                methodArgNames asSortedCollection do:[:methodArgName |
+                    names add:methodArgName.
+                ]
+            ].
+
+            names add:'---- instance variables ----'.
+            self classesInstVarNames asSortedCollection do:[:instVarName |
+                (names includes:instVarName) ifFalse:[
+                    names add:instVarName.
+                ]
+            ]
+        ].
+
+        ^ names
     ].
     ^ nil
+
+    "Modified: 16.12.1996 / 18:13:11 / cg"
 !
 
 selectorCheck:aSelectorString for:receiver position:pos1 to:pos2
@@ -3011,7 +3013,7 @@
                             errorFlag := true
                         ] ifFalse:[
                             (t == #InstanceVariable) ifTrue:[
-                                name := PrevInstVarNames at:(var index).
+                                name := self classesInstVarNames at:(var index).
 
                                 "/ ca once did this to `name' and wondered what happened to his class ...
                                 "/ (not really a beginners bug, but may happen as a typo or missing local variable;
@@ -3235,7 +3237,7 @@
     ^ #Error
 
     "Created: 13.9.1995 / 12:50:50 / claus"
-    "Modified: 8.11.1996 / 18:35:39 / cg"
+    "Modified: 16.12.1996 / 18:11:56 / cg"
 !
 
 statement
@@ -3842,6 +3844,6 @@
 !Parser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.112 1996-12-10 21:47:11 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.113 1996-12-16 17:16:09 cg Exp $'
 ! !
 Parser initialize!