Of late, though I have been working (which is to say: coding) on the Handlers, I have been working (which is to say: thinking) on Radish. Tied directly to radish is the problem of how to parse the structured text occuring inside some triggers.
I've done so much deferral of solving this problem that my thinking was still stuck in the pre-2004 era, when everything was line-oriented and based around decomposition of lines with regexes. Not until this morning's shower did I realize that I have a perfectly good LALR lexer -- which can be fed arbitrary strings as well as files -- already coded and waiting to be used.
What this means is that structured text doesn't have to be ridgidly line-oriented the way many wiki dialects are; whitespace can be insignificant, as it is with most programming languages. A table, for instance, could (hypothetically) look like
r1c1 ;; r1c2 --- r2c1 ;; r2c2or
r1c1 ;; r1c2and so on. Duh.
---
r2c1 ;; r2c2
Also, it strikes me just now that Handler->lex should perhaps use substr() where possible instead of regexes. This would cut down on the need for escaping and possible complications arising from it.
No comments:
Post a Comment