[Pkg] The Trunk: Compiler-nice.207.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Apr 20 00:18:33 UTC 2011

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

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

Name: Compiler-nice.207
Author: nice
Time: 20 April 2011, 2:18:01.027 am
UUID: 592f6683-4ee7-483c-b723-50ba8fc53afb
Ancestors: Compiler-ul.206

Oops, use #canDeclareInstanceVariable where due.
This message was created on purpose, and has no reason to remain unsent.

=============== Diff against Compiler-ul.206 ===============

Item was changed:
  ----- Method: UndeclaredVariable>>openMenuIn: (in category 'as yet unclassified') -----
  openMenuIn: aBlock 
  	| alternatives labels actions lines caption choice |
  	alternatives := parser possibleVariablesFor: name.
  	labels := OrderedCollection new.
  	actions := OrderedCollection new.
  	lines := OrderedCollection new.
  	name first isLowercase 
  			[labels add: 'declare method temp'.
  			actions add: [parser declareTemp: name at: #method].
  			labels add: 'declare block-local temp'.
  			actions add: [parser declareTemp: name at: #block].
+ 			parser canDeclareInstanceVariable 
- 			parser canDeclareClassVariable 
  					[labels add: 'declare instance'.
  					actions add: [parser declareInstVar: name]]]
  			[labels add: 'define new class'.
  			actions add: [parser defineClass: name].
  			labels add: 'declare global'.
  			actions add: [parser declareGlobal: name].
  			parser canDeclareClassVariable 
  					[labels add: 'declare class variable'.
  					actions add: [parser declareClassVar: name]]].
  	lines add: labels size.
  	alternatives do: 
  		[:each | 
  		labels add: each.
  		actions add: [parser substituteVariable: each atInterval: interval]].
  	lines add: labels size.
  	labels add: 'cancel'.
  	caption := 'Unknown variable: ' , name , ' please correct, or cancel:'.
  	choice := aBlock value: labels value: lines value: caption.
  	self resume: (actions at: choice ifAbsent: [nil])!

More information about the Packages mailing list