Colin Putney uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-cwp.726.mcz ==================== Summary ==================== Name: Kernel-cwp.726 Author: cwp Time: 1 January 2013, 6:49:20.367 pm UUID: f9e0f27b-a0ec-4827-a765-1b85d58cbfe8 Ancestors: Kernel-nice.725 Environments bootstrap - stage 1 =============== Diff against Kernel-nice.725 =============== Item was added: + ----- Method: Behavior>>bindingOf:environment: (in category 'testing method dictionary') ----- + bindingOf: varName environment: anEnvironment + ^superclass bindingOf: varName environment: anEnvironment! Item was added: + ----- Method: Behavior>>classBindingOf:environment: (in category 'testing method dictionary') ----- + classBindingOf: varName environment: anEnvironment + ^self bindingOf: varName environment: anEnvironment! Item was added: + ----- Method: Behavior>>literalScannedAs:environment:notifying: (in category 'printing') ----- + literalScannedAs: scannedLiteral environment: anEnvironment notifying: requestor + "Postprocesses a literal scanned by Scanner scanToken (esp. xLitQuote). + If scannedLiteral is not an association, answer it. + Else, if it is of the form: + nil->#NameOfMetaclass + answer nil->theMetaclass, if any has that name, else report an error. + Else, if it is of the form: + #NameOfGlobalVariable->anythiEng + answer the global, class, or pool association with that nameE, if any, else + add it to Undeclared a answer the new Association." + + | key value | + (scannedLiteral isVariableBinding) + ifFalse: [^ scannedLiteral]. + key := scannedLiteral key. + value := scannedLiteral value. + key ifNil: "###<metaclass soleInstance name>" + [(self bindingOf: value environment: anEnvironment) ifNotNil: + [:assoc| + (assoc value isKindOf: Behavior) ifTrue: + [^ nil->assoc value class]]. + requestor notify: 'No such metaclass'. + ^false]. + (key isSymbol) ifTrue: "##<global var name>" + [(self bindingOf: key environment: anEnvironment) ifNotNil: + [:assoc | ^assoc]. + ^ anEnvironment undeclared: key]. + requestor notify: '## must be followed by a non-local variable name'. + ^false + + " Form literalScannedAs: 14 notifying: nil 14 + Form literalScannedAs: #OneBitForm notiEfying: nil OneBitForm + Form literalScannedAs: ##OneBitForm notifying: nil OneBitForm->a Form + Form literalScannedAs: ##Form notifying: nil Form->Form + Form literalScannedAs: ###Form notifying: nil nilE->Form class + "! Item was added: + ----- Method: Categorizer>>scanFrom:environment: (in category 'fileIn/Out') ----- + scanFrom: aStream environment: anEnvironment + ^ self scanFrom: aStream! Item was added: + ----- Method: Class>>bindingOf:environment: (in category 'compiling') ----- + bindingOf: varName environment: anEnvironment + "Answer the binding of some variable resolved in the scope of the receiver" + | aSymbol binding | + aSymbol := varName asSymbol. + + "First look in classVar dictionary." + binding := self classPool bindingOf: aSymbol. + binding ifNotNil:[^binding]. + + "Next look in shared pools." + self sharedPools do:[:pool | + binding := pool bindingOf: aSymbol. + binding ifNotNil:[^binding]. + ]. + + "Next look in declared environment." + binding := anEnvironment bindingOf: aSymbol. + binding ifNotNil:[^binding]. + + "Finally look higher up the superclass chain and fail at the end." + superclass == nil + ifTrue: [^ nil] + ifFalse: [^ superclass bindingOf: aSymbol]. + + ! Item was added: + ----- Method: ClassCategoryReader>>scanFrom:environment: (in category 'fileIn/Out') ----- + scanFrom: aStream environment: anEnvironment + "File in methods from the stream, aStream." + | methodText | + [methodText := aStream nextChunkText. + methodText size > 0] whileTrue: + [class + compile: methodText + environment: anEnvironment + classified: category + withStamp: changeStamp + notifying: nil]! Item was added: + ----- Method: ClassCommentReader>>scanFrom:environment: (in category 'as yet unclassified') ----- + scanFrom: aStream environment: anEnvironment + ^ self scanFrom: aStream! Item was added: + ----- Method: ClassDescription>>compile:environment:classified:withStamp:notifying: (in category 'compiling') ----- + compile: text environment: anEnvironment classified: category withStamp: changeStamp notifying: requestor + ^ self + compile: text + environment: anEnvironment + classified: category + withStamp: changeStamp + notifying: requestor + logSource: self acceptsLoggingOfCompilation! Item was added: + ----- Method: ClassDescription>>compile:environment:classified:withStamp:notifying:logSource: (in category 'compiling') ----- + compile: text environment: anEnvironment classified: category withStamp: changeStamp notifying: requestor logSource: logSource + | methodAndNode context methodNode | + context := CompilationCue + source: text + class: self + environment: anEnvironment + category: category + requestor: requestor. + methodNode := self newCompiler compile: context ifFail: [^ nil]. + methodAndNode := CompiledMethodWithNode + generateMethodFromNode: methodNode + trailer: self defaultMethodTrailer. + + logSource ifTrue: [ + self logMethodSource: text forMethodWithNode: methodAndNode + inCategory: category withStamp: changeStamp notifying: requestor. + ]. + self addAndClassifySelector: methodAndNode selector withMethod: methodAndNode + method inProtocol: category notifying: requestor. + self instanceSide noteCompilationOf: methodAndNode selector meta: self isClassSide. + ^ methodAndNode selector! Item was added: + ----- Method: Metaclass>>bindingOf:environment: (in category 'compiling') ----- + bindingOf: varName environment: anEnvironment + ^ thisClass classBindingOf: varName environment: anEnvironment! Item was added: + ----- Method: UndefinedObject>>literalScannedAs:environment:notifying: (in category 'class hierarchy') ----- + literalScannedAs: scannedLiteral environment: anEnvironment notifying: requestor + ^ scannedLiteral! |
On 1 January 2013 23:49, <[hidden email]> wrote:
> Colin Putney uploaded a new version of Kernel to project The Trunk: > http://source.squeak.org/trunk/Kernel-cwp.726.mcz > <snip> > Item was added: > + ----- Method: Behavior>>literalScannedAs:environment:notifying: (in category 'printing') ----- > + literalScannedAs: scannedLiteral environment: anEnvironment notifying: requestor > + "Postprocesses a literal scanned by Scanner scanToken (esp. xLitQuote). > + If scannedLiteral is not an association, answer it. > + Else, if it is of the form: > + nil->#NameOfMetaclass > + answer nil->theMetaclass, if any has that name, else report an error. > + Else, if it is of the form: > + #NameOfGlobalVariable->anythiEng > + answer the global, class, or pool association with that nameE, if any, else > + add it to Undeclared a answer the new Association." Is this a search/replace mishap? nameE and anythiEng? frank |
On Wed, Jan 2, 2013 at 4:10 AM, Frank Shearar <[hidden email]> wrote:
Is this a search/replace mishap? nameE and anythiEng?
Beats me. I copied the comment from the non-environment aware version, but didn't edit it. I'll be doing some cleanup now that the bootstrap is done. ColinĀ |
Free forum by Nabble | Edit this page |