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

Benjamin Van Ryseghem benjamin.vanryseghem.pharo at gmail.com
Sat Feb 26 12:35:47 CET 2011


JB and I were discuting about changing the SHParser by PetitParser, maybe
your problem is a good excuse to do it :°


Ben


2011/2/26 Edouard Poor <edouard.lists at gmail.com>

> 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.
>
> Cheers,
> Edouard.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/pharo-project/attachments/20110226/fcee4a0f/attachment.htm>


More information about the Pharo-project mailing list