Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Recursive parsing (WAS: colored text)

 [1/1] from: mario::cassani::icl::com at: 21-Nov-2001 15:28


Hi all, a reply/answer to my question follows in order to help people with the same problems with an easy to search subject.
> > The color-text VID style uses very simple dialect like: > >
<<quoted lines omitted: 6>>
> me writing a short example showing how to colorise the below > example only (at the bottom)?
[...]
> ; *** Botton example is this *** > ;
<<quoted lines omitted: 15>>
> ] > ]
the solution is (word wrap will kill it, I know):
>> levels: 0
== 0
>> original-text: ">> > >Questa e' una linea di prova http://www.rebol.com
scrivi a [carl--rebol--com] e pure a me"
>> parse original-text [any [["> " | #">"] (levels: levels + 1)] copy
clean-text to end] == true
>> clean-text
== {Questa e' una linea di prova http://www.rebol.com scrivi a [carl--rebol--com] e pure a me}
>> levels
== 4 using levels I can select a colour in a 'serie for the original text... Now I miss an 'url! and 'email! "catcher". I remember a /view script showing underlined and browseable URLs in a text file. Can someone tell me the example's URL (I am behind a proxy that prevents REBOL to see the World Wide Reb)? Thanks again Mario

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted