[squeak-dev] The Trunk: Kernel-nice.808.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Sep 20 19:52:39 UTC 2013


Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.808.mcz

==================== Summary ====================

Name: Kernel-nice.808
Author: nice
Time: 20 September 2013, 9:51:16.441 pm
UUID: 0538a438-3c3f-4580-a21e-6d7da6c5faca
Ancestors: Kernel-nice.807

Don't pass a category to a Compiler, classifying is not its job.

=============== Diff against Kernel-nice.807 ===============

Item was changed:
  ----- Method: Behavior>>compile:notifying: (in category 'compiling') -----
  compile: code notifying: requestor 
  	"Compile the argument, code, as source code in the context of the 
  	receiver and insEtall the result in the receiver's method dictionary. The 
  	second argument, requestor, is to be notified if an error occurs. The 
  	argument code is either a string or an object that converts to a string or 
  	a PositionableStream. This method also saves the source code."
  	
  	| methodAndNode |
  	methodAndNode  := self
  		compile: code "a Text"
- 		classified: nil
  		notifying: requestor
  		trailer: self defaultMethodTrailer
  		ifFail: [^nil].
  	methodAndNode method putSource: code fromParseNode: methodAndNode node inFile: 2
  			withPreamble: [:f | f cr; nextPut: $!!; nextChunkPut: 'Behavior method'; cr].
  	self addSelector: methodAndNode selector withMethod: methodAndNode method notifying: requestor.
  	^ methodAndNode selector!

Item was added:
+ ----- Method: Behavior>>compile:notifying:trailer:ifFail: (in category 'compiling') -----
+ compile: code notifying: requestor trailer: bytes ifFail: failBlock
+ 	"Compile code without logging the source in the changes file"
+ 
+ 	| methodNode |
+ 	methodNode  := self newCompiler
+ 				compile: code
+ 				in: self
+ 				notifying: requestor
+ 				ifFail: failBlock.
+ 	^ CompiledMethodWithNode generateMethodFromNode: methodNode trailer: bytes.!

Item was changed:
  ----- Method: Behavior>>firstPrecodeCommentFor: (in category 'accessing method dictionary') -----
  firstPrecodeCommentFor:  selector
  	"If there is a comment in the source code at the given selector that preceeds the body of the method, return it here, else return nil"
  
  	| parser source tree |
  	"Behavior firstPrecodeCommentFor: #firstPrecodeCommentFor:"
  	(#(Comment Definition Hierarchy) includes: selector)
  		ifTrue:
  			["Not really a selector"
  			^ nil].
  	source := self sourceCodeAt: selector asSymbol ifAbsent: [^ nil].
  	parser := self newParser.
  	tree := 
  		parser
  			parse: (ReadStream on: source)
  			class: self
  			noPattern: false
- 			context: nil
  			notifying: nil
  			ifFail: [^ nil].
  	^ (tree comment ifNil: [^ nil]) first!

Item was changed:
  ----- Method: ClassDescription>>compile:classified:withStamp:notifying:logSource: (in category 'compiling') -----
  compile: text classified: category withStamp: changeStamp notifying: requestor logSource: logSource
  	| methodAndNode |
+ 	methodAndNode := self compile: text asString notifying: requestor
- 	methodAndNode := self compile: text asString classified: category notifying: requestor
  							trailer: self defaultMethodTrailer ifFail: [^nil].
  	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 changed:
  ----- 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!



More information about the Squeak-dev mailing list