[squeak-dev] The Trunk: Morphic-nice.526.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Mar 30 19:31:38 UTC 2011

Nicolas Cellier uploaded a new version of Morphic to project The Trunk:

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

Name: Morphic-nice.526
Author: nice
Time: 30 March 2011, 9:29:10.003 pm
UUID: 27e938fd-2a8b-4cb5-a6a0-75c76e62cdbb
Ancestors: Morphic-dtl.525

Use #newCompiler #newParser

=============== Diff against Morphic-dtl.525 ===============

Item was changed:
  ----- Method: TextEditor>>explainTemp: (in category 'explain') -----
  explainTemp: string 
  	"Is string the name of a temporary variable (method or block argument or temporary)?"
  	| selectedClass methodNode tempNode |
  	(model respondsTo: #selectedMessageName) ifFalse: [^ nil].
  	model selectedMessageName ifNil: [^nil].	"not in a method"
  	selectedClass := model selectedClassOrMetaClass.
+ 	methodNode := selectedClass newParser parse: model selectedMessage class: selectedClass.
- 	methodNode := selectedClass parserClass new parse: model selectedMessage class: selectedClass.
  	tempNode := methodNode encoder tempNodes detect: [:n| n name = string] ifNone: [^nil].
  	^(tempNode isArg
  		ifTrue: ['"is an argument to this ']
  		ifFalse: ['"is a temporary variable in this ']),
  	   (tempNode isDeclaredAtMethodLevel
  		ifTrue: ['method"']
  		ifFalse: ['block"'])!

Item was changed:
  ----- Method: TextEditor>>prettyPrint: (in category 'menu messages') -----
  prettyPrint: decorated 
  	"Reformat the contents of the receiver's view (a Browser)."
  	| selectedClass newText |
  	selectedClass := model selectedClassOrMetaClass.
  	selectedClass ifNil: [ ^ morph flash ].
+ 	newText := selectedClass newCompiler
- 	newText := selectedClass compilerClass new
  		format: self text
  		in: selectedClass
  		notifying: self
  		decorated: decorated.
  	newText ifNotNil:
  		[ self
  			deselect ;
  			selectInvisiblyFrom: 1
  			to: paragraph text size.
  		self replaceSelectionWith: (newText asText makeSelectorBoldIn: selectedClass).
  		self selectAt: self text size + 1 ]!

More information about the Squeak-dev mailing list