[squeak-dev] The Trunk: Compiler-eem.163.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Aug 17 01:35:56 UTC 2010


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

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

Name: Compiler-eem.163
Author: eem
Time: 16 August 2010, 6:35:39.357 pm
UUID: cd09cd52-fc4d-4999-83a6-0c89585a4caa
Ancestors: Compiler-eem.159

Fix compilation after error correction.  If interactive then on correction
the entire text should be recompiled if the entire text was input (e.g.
compiling a method in a browser).  But if a selection was compiled
(e.g. doit in a workspace) then the current selection should be
recompiled.

Fix VariableScopeFinder for cascades.

=============== Diff against Compiler-eem.159 ===============

Item was changed:
  ----- Method: VariableScopeFinder>>visitCascadeNode: (in category 'visiting') -----
  visitCascadeNode: aCascadeNode
  	"Answer the minimum enclosing node for aVariabe or nil if none.
  	 If the variable is accessed in more than one subexpression then aMessageNode is the
  	 enclosing node, otherwise it is which ever single node that includes it, if any."
  	^self
  		enclosingNodeFor: [:aBlock|
  							aBlock value: aCascadeNode receiver.
  							aCascadeNode messages do:
+ 								[:msg| msg argumentsInEvaluationOrder do: aBlock]]
- 								[:each| aCascadeNode argumentsInEvaluationOrder do: aBlock]]
  		of: aCascadeNode!

Item was changed:
  ----- Method: Parser>>parse:class:category:noPattern:context:notifying:ifFail: (in category 'public access') -----
  parse: sourceStream class: class category: aCategory noPattern: noPattern context: ctxt notifying: req ifFail: aBlock 
  	"Answer a MethodNode for the argument, sourceStream, that is the root of
  	 a parse tree. Parsing is done with respect to the argument, class, to find
  	 instance, class, and pool variables; and with respect to the argument,
  	 ctxt, to find temporary variables. Errors in parsing are reported to the
  	 argument, req, if not nil; otherwise aBlock is evaluated. The argument
  	 noPattern is a Boolean that is true if the the sourceStream does not
  	 contain a method header (i.e., for DoIts)."
  
+ 	| methNode repeatNeeded myStream s p subSelection |
- 	| methNode repeatNeeded myStream s p |
  	category := aCategory.
  	myStream := sourceStream.
  	[repeatNeeded := false.
  	 p := myStream position.
  	 s := myStream upToEnd.
  	 myStream position: p.
+ 	 subSelection := req notNil and: [req selectionInterval = (p + 1 to: p + s size)].
  	 self encoder init: class context: ctxt notifying: self.
  	 self init: myStream notifying: req failBlock: [^ aBlock value].
  	 doitFlag := noPattern.
  	 failBlock:= aBlock.
  	 [methNode := self
  					method: noPattern
  					context: ctxt] 
  		on: ReparseAfterSourceEditing 
  		do:	[ :ex |
  			repeatNeeded := true.
+ 			myStream := subSelection
+ 							ifTrue:
+ 								[ReadStream
+ 									on: requestor text string
+ 									from: requestor selectionInterval first
+ 									to: requestor selectionInterval last]
+ 							ifFalse:
+ 								[ReadStream on: requestor text string]].
- 			myStream := ReadStream
- 							on: requestor text string
- 							from: requestor selectionInterval first
- 							to: requestor selectionInterval last].
  	 repeatNeeded] whileTrue:
  		[encoder := self encoder class new].
  	methNode sourceText: s.
+ 	^methNode!
- 	^methNode
- !




More information about the Squeak-dev mailing list