[Pharo-project] SHParserST80 and the types: #- and #'$'

Edouard Poor edouard.lists at gmail.com
Sat Feb 26 10:31:47 CET 2011

I was trying to write the most compact source code to HTML/CSS I could come
up with:

parser := SHParserST80 new.

code := OrderedCollection sourceCodeAt: #sort:.
ranges := parser rangesIn: code classOrMetaClass: OrderedCollection
workspace: nil environment: nil.

dict := Dictionary with: 1->#whitespace.
ranges do: [ :range | dict add: range start -> range type; add: range end +
1 -> #whitespace ].
spans := dict associations sorted overlappingPairsCollect: [ :a :b |
'<span class="', a value, '">', (code copyFrom: a key to: b key - 1),
'</span>' ].

but SHParserST80's use of #- and #'$' might mess things up a little. What do
you think about replacing those two symbols with textual versions (like
#minus #characterPrefix)?

I'm kind of serious - Shout's two non-textual type names seem ugly.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/pharo-project/attachments/20110226/fd9183f3/attachment.htm>

More information about the Pharo-project mailing list