Proposal4: Show := on fileout / pretty print

Stefan Matthias Aust sma at 3plus4.de
Sun May 28 17:46:02 UTC 2000


[Yes, I'll shut up in a minute]

PROPOSAL

Currently, pretty printing doesn't keep the original assignment operator of 
the source but replaces it with "_".  It should however have three modi

  * keep it (only applicable if source is available)
  * always use _
  * always use :=

For fileout, another (two) options might be useful:

  * replace _ with :=, but don't touch any other formatting
  * replace := with _, but don't touch any other formatting

this is more as a simple find/replace as it should of course not touch 
strings or symbols or literals.


BACKWARD COMPATIBILITY ISSUES

None, if we set the switch to the right value.


ADVANTAGES

ANSI conformance as well as conform with VisualWorks, Dolphin ST, VisualAge 
and probabyl also other Smalltalk systems.


IMPLEMENTATION ISSUES

AssignmentNode>>printOn:indent: is the place to change if printing. The 
switch should be added as class variable to Scanner or Parser though.

Parser>>assignment: needs to be changed to keep the current assignment 
operator, as well as Scanner>>xColon and Parser>>expression.  The easiest 
way is to add a flag to AssignmentNode and introduce #assignmentOp 
additional to #leftArrow.


bye
--
Stefan Matthias Aust  //  Bevor wir fallen, fallen wir lieber auf





More information about the Squeak-dev mailing list