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

[REBOL] [parse] backslah inside dialect ?

From: gregg::pointillistic::com at: 10-Jun-2007 7:27

Hi Arnaud, AG> how to insert a backslah inside a dialect ? Do you want to do string or block parsing? If you want to do string parsing, you're close; if you want to do block parsing, you're out of luck, because a backslash-prefixed word isn't valid REBOL. In that case, I would use refinements. ; string rules: [ any [ "\og" ( print "open") | "\fg" (print "close") | skip ] ] parse "this is \og an example \fg" rules ; block rules: [ any [ /og (print "open") | /fg (print "close") | skip ] ] parse [this is /og an example /fg] rules HTH! -- Gregg