[Pkg] The Trunk: Compiler-eem.444.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Oct 9 17:59:41 UTC 2020


Eliot Miranda uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-eem.444.mcz

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

Name: Compiler-eem.444
Author: eem
Time: 9 October 2020, 10:59:39.150557 am
UUID: 52facf73-6ea8-4abc-8053-242eacfbb0ec
Ancestors: Compiler-eem.443

Stage one of refactoring of CompilationCue so that compile:environment:classified:withStamp:notifying:logSource: can be refactored into compileCue:environment:classified:withStamp:notifying:logSource: to allow easy installation of methods with different encoder classes (for tests of full vs embedded blocks).

=============== Diff against Compiler-eem.443 ===============

Item was changed:
  Object subclass: #CompilationCue
+ 	instanceVariableNames: 'source sourceStream context receiver class environment requestor encoderClass'
- 	instanceVariableNames: 'source context receiver class environment requestor'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'Compiler-Kernel'!
  
  !CompilationCue commentStamp: 'eem 3/30/2017 17:32' prior: 0!
  A CompilationCue is a helper class holding enough context for evaluating/compiling Smalltalk code.
  
  That is mainly the source code, and the source code editor to interact with if the Compiler is used interactively.
  But that is also any additional information necessary to resolve variable names.
  
  When compiling a method, the Compiler typically need to know the target class in which to install the method.
  
  When evaluating an expression, the Compiler also needs a receiver (for accessing the value of its instance variables), its class (for resolving instance/class variable names), and optionnally a context of execution when debugging a method (for accessing values of temporaries and parameters).
  
  Instance Variables
  	class:			<Behavior>
  	context:		<Context | nil>
  	environment:	<Environment | nil>
  	receiver:		<Object>
  	requestor:		<TextEditor | nil>
  	source:			<Stream>
  
  class
  	- the target class in which to install the compiled method;
  	  this enables to resolve the instance variable names, class variable names and shared pool variable names.
  	  When evaluating, this should be the receiver class
  
  context
  	- the context introspected when evaluating the code: this is typically for accessing parameters and temporary variables when debugging
  
  environment
  	- the environment in which to resolve global variable names
  
  receiver
  	- the receiver into which to evaluate the code: this is typically for accessing instance variables in an inspector
  
  requestor
  	- typically the text editor containing the source code being compiled/evaluated. This enables the Compiler to interact in case of syntax error.
  
  source
  	- a ReadStream on the source code to be compiled
  !

Item was changed:
  ----- Method: CompilationCue>>initializeWithSource:context:receiver:class:environment:requestor: (in category 'initialization') -----
  initializeWithSource: aTextOrString context: aContext receiver: recObject class: aClass environment: anEnvironment requestor: reqObject
  	self initialize.
+ 	source := aTextOrString isStream
+ 					ifTrue: [aTextOrString]
+ 					ifFalse: [ReadStream on: aTextOrString asString].
+ 	sourceStream := aTextOrString isStream
+ 					ifTrue: [aTextOrString]
+ 					ifFalse: [ReadStream on: aTextOrString asString].
- 	source := (aTextOrString isKindOf: PositionableStream)
- 		ifTrue: [ aTextOrString ]
- 		ifFalse: [ ReadStream on: aTextOrString asString ].
  	context := aContext.
  	receiver := recObject.
  	class := aClass.
  	environment := anEnvironment.
  	requestor := reqObject!



More information about the Packages mailing list