[squeak-dev] swiki source suited to recent Squeaks
tim at rowledge.org
Sat Aug 10 23:29:11 UTC 2019
> On 2019-08-10, at 3:04 PM, Levente Uzonyi <leves at caesar.elte.hu> wrote:
> I wrote and attached a different actor, which builds a simple dom tree, which can be turned into a string:
> GoogleWikiCompiler example asString
> should give
> '<div><p>Single paragraph with <strong>bold</strong> and <em>italic</em> text and a <a href="link.html">link</a></p></div>'
> It has no external dependencies but Xtreams-Parsing, so it doesn't need monty's XMLParser to be loaded.
Excellent. That would simplify life a bit.
I spent some fun time trying to work out how on earth the parserparserparserparser (did I go deep enough yet?) works; it's very clever. The problem is that it is edging into the cleverness danger zone - remember that it takes roughly twice as much 'clever' to debug something as it does to write it, and so writing something with all your clever means that you won't be able to debug it.
Eventually I got the hang of enough to spot where the link problem was having trouble. Basically, the Sequence rule ends up making [link] into '[' and #( $l $i $n $k) and ']'. By what I suspect is mostly good luck the xml printing that gets used to convert it into the content of the html anchor tag wants a collection of characters to iterate over rather than just a String to print, so that bit works. The #newText: method wants an actual String; as a hack fix I made that convert the address parameter to an actual String. Now that's all very well and might even be the right solution but it could also be a bug in the source grammar for all I know. It's not like the package is exactly overloaded with helpful comments.
I'll take a look at your googlewiki later; got scaffolding to dismantle and reconfigure for some high altitude painting.
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: RC: Rewind Core
More information about the Squeak-dev