--- a/Parser.st Wed Jul 02 12:48:09 2003 +0200
+++ b/Parser.st Mon Jul 14 09:42:45 2003 +0200
@@ -934,7 +934,7 @@
method := homeContext method.
"/ #doIt needs special handling below
- isDoIt := (sel == #doIt) or:[sel == #doIt:].
+ isDoIt := (sel == #'doIt') or:[sel == #'doIt:'].
aContext isBlockContext ifFalse:[
isDoIt ifTrue:[
method notNil ifTrue:[
@@ -2123,7 +2123,7 @@
(classToCompileFor notNil
and:[classToCompileFor isMeta not
and:[classToCompileFor isBuiltInClass not
- and:[selector notNil and:[selector ~~ #doIt]]]]) ifTrue:[
+ and:[(self isDoIt not)]]]) ifTrue:[
l := l copyWith:'Instance Variable'.
how := how copyWith: #InstanceVariable.
].
@@ -2133,7 +2133,7 @@
(classToCompileFor notNil
and:[classToCompileFor isBuiltInClass not
- and:[selector notNil and:[selector ~~ #doIt]]]) ifTrue:[
+ and:[self isDoIt not]]) ifTrue:[
classToCompileFor isMeta ifTrue:[
l := l , #('Class Instance Variable').
how := how , #( ClassInstanceVariable).
@@ -2142,7 +2142,7 @@
how := how , #( ClassVariable).
]
].
- (selector isNil or:[selector == #doIt]) ifTrue:[
+ self isDoIt ifTrue:[
l size > 0 ifTrue:[
l := l , #( '-' ).
how := how , #( nil ).
@@ -2883,7 +2883,9 @@
has the same name as a variable, cannot be understood or is obsolete.
Simple, but catches many typos"
- |err sym rec names recType selClass newSelector nm nowhereImplemented pos1 pos2|
+ |err sym rec names recType selClass newSelector nm nowhereImplemented pos1 pos2 canDefine|
+
+ canDefine := false.
pos1 := posVector first start.
pos2 := posVector last stop.
@@ -2988,7 +2990,8 @@
err := subErr, ' in this class, superclass chain or all subclasses'
] ifFalse:[
err := err, ' in this class or superclass chain'.
- ].
+ ].
+ canDefine := true.
].
] ifFalse:[(receiver isUnaryMessage
and:[receiver selector == #class
@@ -3071,7 +3074,7 @@
self markUnknownIdentifierFrom:(p start) to:(p stop).
].
].
- err := err , '\\This is a warning from the compiler - the code has not yet been executed/compiled'.
+ err := err , '\\This is a warning from the compiler - the code has not yet been executed/compiled.'.
newSelector := self correctSelector:aSelectorString
message:err withCRs positions:posVector in:selClass for:receiver.
"/ self warning:('#' , aSelectorString , '\\' , err) withCRs position:pos1 to:pos2.
@@ -3530,7 +3533,7 @@
value := method
valueWithReceiver:anObject
arguments:nil "/ (Array with:m)
- selector:(requestor isNil ifTrue:#doItX ifFalse:#doIt) "/ #doIt:
+ selector:(requestor isNil ifTrue:#'doItX' ifFalse:#'doIt') "/ #doIt:
search:nil
sender:nil.
] ifFalse:[
@@ -5524,7 +5527,7 @@
varName := tokenName.
- ((selector isNil or:[selector == #doIt])
+ (self isDoIt
and:[currentBlock isNil
and:[(requestor askFor:#isWorkspace)
and:[(autoHow := requestor autoDefineVariables) notNil]]]) ifTrue:[
@@ -6345,7 +6348,7 @@
"/ first, for the parse, then as a block-code
"/ for the code.
"/ We only care for WorkspaceVars in doIts
- (selector isNil or:[selector == #doIt]) ifTrue:[
+ (self isDoIt) ifTrue:[
(Workspace notNil
and:[(holder := Workspace workspaceVariableAt:varName) notNil])
ifTrue:[
@@ -6361,7 +6364,7 @@
"/ for the code.
"/ We only care for WorkspaceVars in doIts
- (selector isNil or:[selector == #doIt]) ifTrue:[
+ (self isDoIt) ifTrue:[
(doItTemporaries notNil
and:[(holder := doItTemporaries at:varName asSymbol ifAbsent:nil) notNil])
ifTrue:[
@@ -7022,6 +7025,10 @@
^ hasPrimitiveCode
!
+isDoIt
+ ^ (selector isNil or:[selector == #'doIt' or:[selector == #'doIt:']])
+!
+
isSyntaxHighlighter
^ false
!
@@ -7435,7 +7442,7 @@
!Parser class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.400 2003-07-02 10:48:09 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.401 2003-07-14 07:42:45 cg Exp $'
! !
Parser initialize!