[BUG][FIX] Parser declareTempAndPaste:

Alexander Lazarevic Alexander at Lazarevic.de
Fri Oct 1 19:31:31 UTC 1999


Content-Type: text/plain; charset=us-ascii
Content-Description: message body text
Content-Transfer-Encoding: 7bit

I think it is annoying when I try to accept a method like

	transistor
	| flip|
	flip := true. flop := false.

and let the Parser insert the temporary variable flop and get this:

	transistor
	| flipflop |
	flip := true. flop := false.

The included fileIn changes declareTempAndPaste: to check if
there is a whitespace between the last declared variable and the
trailing | character.

Alex.


Content-Type: text/plain
Content-Description: changes declareTempAndPaste: to check if

trailing | character
Content-Disposition: inline;
	filename="Parser-declareTempAndPaste.st"
Content-Transfer-Encoding: 7bit

'From Squeak 2.5 of August 6, 1999 [latest update: #1499] on 1 October 1999 at 8:18:46 pm'!

!Parser methodsFor: 'error correction' stamp: 'laza 10/1/1999 20:18'!
declareTempAndPaste: name
	| insertion tabbed |
	(requestor text string at: tempsMark) = $|
				ifTrue:  "Paste it before the second vertical bar"
					[insertion _ name, ' '.
					(requestor text string at: tempsMark-1) isSeparator
						ifFalse: [insertion _ ' ', insertion].
					tempsMark _ tempsMark +
						(self substituteWord: insertion
							wordInterval: (tempsMark to: tempsMark-1)
							offset: 0)]
				ifFalse:  "No bars - insert some with CR, tab"
					[insertion _ '| ' , name , ' |
'.
					tabbed _ tempsMark > 1
						and: [(requestor text string at: tempsMark-1) = Character tab].
					tabbed
						ifTrue: [insertion _ insertion , (String with: Character tab)].
					tempsMark _ tempsMark +
						(self substituteWord: insertion
							wordInterval: (tempsMark to: tempsMark-1)
							offset: 0)
						- (tabbed ifTrue: [3] ifFalse: [2])].
			^ encoder reallyBind: name! !

Content-Type: text/plain; charset=us-ascii
Content-Description: .signature
Content-Transfer-Encoding: 7bit


-- 
------  Alexander  Lazarevic  ------------------------------------------------
-- Otto-von-Guericke-Universitaet            mailto: Alexander at Lazarevic.de --
--   Computational Visualistics    http://www.cs.uni-magdeburg.de/~lazarevi --





More information about the Squeak-dev mailing list