[squeak-dev] The Inbox: System-ct.1120.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Tue Dec 3 07:53:58 UTC 2019


Hi Marcel, sorry for the really long delay!


I'm afraid that this implementation must be missing at the moment. In my image, I had fast faked it with:


shortPrintString

    ^ self printString copyWithRegex: '\s*' matchesReplacedWith: ' '


But respecting parse trees such as ['  ' , '

'] decompile (sic), I am not sure whether this would be a good implementation ...

Otherwise, implementing something like #shortPrintOn: in every ParseNode class would cause a lot of duplication or, alternatively, raise the complexity of the existing printing methods (each extended with another argument for the print selector to use for descendents).


In general, do you think such a method might be useful at all? If not, the "regex replace" trick could be directly applied in initializeCommonRequestStrings, how do you think about it?


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Taeumel, Marcel
Gesendet: Dienstag, 19. November 2019 12:03:30
An: John Pfersich via Squeak-dev
Betreff: Re: [squeak-dev] The Inbox: System-ct.1120.mcz

Hi Christoph.

Neither #veryShortPrintOn: nor #shortPrintString are implemented in ParseNode. Does this contribution depend on something else?

Best,
Marcel

Am 26.10.2019 22:23:05 schrieb commits at source.squeak.org <commits at source.squeak.org>:

A new version of System was added to project The Inbox:
http://source.squeak.org/inbox/System-ct.1120.mcz

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

Name: System-ct.1120
Author: ct
Time: 26 October 2019, 10:22:46.213469 pm
UUID: 7ed0a01b-5518-e24f-9ead-65e1789c94d4
Ancestors: System-ct.1117

Revise System-ct.1117 (concerning CommonRequestStrings): Fix wrong dependency and improve code formatting

=============== Diff against System-ct.1117 ===============

Item was changed:
----- Method: Utilities class>>initializeCommonRequestStrings (in category 'common requests') -----
initializeCommonRequestStrings
"Initialize the common request strings, a directly-editable list of expressions that can be evaluated from the 'do...' menu."

CommonRequestStrings := StringHolder new contents: (
+ String streamContents: [:stream | self commonRequestBlocks
+ do: [:block | block decompile statements
+ do: [:statement | stream
+ nextPutAll: (statement shortPrintString
+ copyWithRegex: '\s+'
+ matchesReplacedWith: String space);
+ nextPut: $.]
+ separatedBy: [stream cr]]
+ separatedBy: [stream cr; nextPut: $-; cr]])
- String streamContents: [:stream |
- self commonRequestBlocks
- do: [:block |
- block decompile statements
- do: [:statement |
- statement veryShortPrintOn: stream.
- stream nextPut: $.]
- separatedBy: [stream cr]]
- separatedBy: [stream cr; nextPut: $-; cr]])

"Utilities initializeCommonRequestStrings"!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191203/7e166c69/attachment.html>


More information about the Squeak-dev mailing list