[squeak-dev] swiki source suited to recent Squeaks

Chris Cunnington brasspen at gmail.com
Tue Aug 6 05:50:10 UTC 2019


Copy this code into a Workspace and DoIt.

Installer ss
       project: 'MetacelloRepository';
       install: 'ConfigurationOfXMLParser'.
(Smalltalk at: #ConfigurationOfXMLParser) project bleedingEdge load

	wikiGrammar := PEGParser grammarWiki reading. 
	wikiParser := PEGParser parserPEG parse: 'Grammar' stream: wikiGrammar actor: PEGParserParser new.
	 input := 'Single paragraph with *bold* and _italic_ text and a [link]' reading. 
	wikiParser parse: 'Page' stream: input actor: PEGWikiGenerator new

And  you’ll get this. 

 <div><p>Single paragraph with <span style="font-weight: bold">bold</span> and <span style="font-style: italic">italic</span> text and a <a href="link.html">an OrderedCollection($l $i $n $k)</a></p></div>

And, yes, that OrderedCollection is an error meaning it didn’t work entirely. To get insight into that, execute this. You will see the process in medias re. The actor has been changed to nil. What this provides is what you need the Actor subclass for. 

	wikiGrammar := PEGParser grammarWiki reading. 
	wikiParser := PEGParser parserPEG parse: 'Grammar' stream: wikiGrammar actor: PEGParserParser new.
	input := 'Single paragraph with *bold* and _italic_ text and a [link]' reading. 
	wikiParser parse: 'Page' stream: input actor: nil

Chris 

Judas Priest - Living After Midnight
https://www.youtube.com/watch?v=_gopyByrAtY


> On Aug 6, 2019, at 12:28 AM, tim Rowledge <tim at rowledge.org> wrote:
> 
> OK, so allowing metacello to do its thing loaded up a boatload of stuff including FFI (wtf?) that really isn't going to be of any use for this problem, but whatever. 
> 
> (And, as an aside, does anyone else get a bit irritated by the plethora of ways stuff gets loaded? So far in my recent quest I have had to use metacello #configuration:/#load, #baseline:/#repository/#load, install #project:/#addPackage:/#install, installer #merge:/MaInstaller #merge:, SqueakMap and plain MC loading. Wheee!)
> 
> But still no XMLString. The metacello configurations all seem to use 'Xtreams-Parsing-Martin Kobetic.2' in the only reference to any package with a name including 'pars'. The problem with googling for 'XMLString' is the commonality of the dratted word. Once one finds the right key it always seems so obvious... hindsight being so very clear.
> 
> I finally found a version of 'monty's xml-parser' on squeakmap which
> a) took ages to install
> b) overwrites an XML-Parser category we already have in Squeak 5.2, so who knows what gets mixed up
> c) does actually, finally, include a class named XMLString. I wonder if it will be friendly?
> d) adds *11* new entries to Undeclared! Good grief.
> 
> What a mess we've let ourselves get into.
> 
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Any nitwit can understand computers.  Many do.
> 
> 
> 



More information about the Squeak-dev mailing list