[REBOL] Re: parse, again...
From: nitsch-lists:netcologne at: 3-Nov-2001 3:46
RE: [REBOL] Re: parse, again...
Hi
[hallvard--ystad--helpinhand--com] wrote:
> Thanks, Ingo. Now the fact is, the 'html-code rule I presented here is a
> pretty simplified one. The one I _really_ use triggers different functions
> depending on _what_ tag I get. It's 41 lines long. Since both 'load and
> 'parse are natvie, I doubt there would be any performance gain on changing
> to load/markup (and adding the code to trigger actions for different tags
> elsewhere). Or??
>
hmm, if you want to use
.. "<" [to "href" .. | to "font" ..] to ">" ..
you get a problem:
parse would look for a href before it looks for font.
so with "<font> <href>" it would find the href and return it,
with all the font-tag-stuff before.
font
would olny be searched if there is no "href" anywhere in the text.
so it can make sense to pre-parse all tags and analyse them in a seperate
parse-call.
.. copy tag "<" thru ">" (parse tag [to "href" .. | to "font" ..]) ..
in that case load/markup would do the same.
> Thanks Volker and Ladislav too. Volker: I can't seem to get your rule and
> Ladislav's to behave differently. They both react only if there is at least
> one character in the sitrng.
>
Yes, its just another way to say it.
well, i was fighting a while until i solved this, so i was eager to reply too ;-)
oh, and it has [to end] in it!!
> So it was indeed a bug that bugged me, not only (as it normally is) my lack
> of rebolism.
>
i think having [thru end] to say "i got all, stop!" would be a feature.
our solutions work pretty, but not that obvious.
> ~H
>
-Volker