[squeak-dev] The Trunk: Compiler-nice.272.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Sep 23 20:54:58 UTC 2013

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

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

Name: Compiler-nice.272
Author: nice
Time: 23 September 2013, 10:54:23.436 pm
UUID: c8f1967f-bcf0-4808-af82-b3db07857493
Ancestors: Compiler-nice.271

Fix for this scenario:
1) a SyntaxError occurs while loading a method with a <primitive:> pragma
  For example, the method uses underscore asssignments, but you did not enable the Preferences allowing historical code...
2) You either enable the underscore assignment Preferences, or replace the underscores with := in SyntaxError window, then accept
3) Bing: you get another complaint <primitive: 103ambiguous primitive->>

This is because the properties were incorrectly accumulated thru each ReparseAfterSourceEditing...

=============== Diff against Compiler-nice.271 ===============

Item was changed:
  ----- Method: Parser>>parseCue:noPattern:ifFail: (in category 'public access') -----
  parseCue: aCue noPattern: noPattern ifFail: aBlock 
  	"Answer a MethodNode for the argument, sourceStream, that is the root of
  	 a parse tree. Parsing is done with respect to the CompilationCue to 
  	 resolve variables. Errors in parsing are reported to the cue's requestor; 
  	 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 |
  	myStream := aCue sourceStream.
  	[repeatNeeded := false.
  	 p := myStream position.
  	 s := myStream upToEnd.
  	 myStream position: p.
  	 subSelection := aCue requestor notNil and: [aCue requestor selectionInterval = (p + 1 to: p + s size)].
  	 self encoder init: aCue notifying: self.
  	 self init: myStream cue: aCue failBlock: [^ aBlock value].
  	 doitFlag := noPattern.
  	 failBlock:= aBlock.
  	 [methNode := self method: noPattern context: cue context] 
  		on: ReparseAfterSourceEditing 
  		do:	[ :ex |
  			repeatNeeded := true.
+ 			properties := nil. "Avoid accumulating pragmas and primitives Number"
  			myStream := ex newSource 
  				ifNil: [subSelection
  									on: cue requestor text string
  									from: cue requestor selectionInterval first
  									to: cue requestor selectionInterval last]
  								[ReadStream on: cue requestor text string]]
  				ifNotNil: [:src | myStream := src readStream]].
  	 repeatNeeded] whileTrue:
  		[encoder := self encoder class new].
  	methNode sourceText: s.

More information about the Squeak-dev mailing list