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

[REBOL] Big parse rules

From: AJMartin:orcon at: 19-Jul-2003 20:15

Anyone know how to turn a parse rule into a function? Here's my situation. I've got a pile of 'parse rules in my eText function (I'm rewriting it to make it smaller, faster, and more versatile), and I find I need some sort of function-like ability, to keep the rules for a section together, apart from the rest, and able to be reused or nested. Table_Printable^: exclude Printable charset #"|" Table_Cell^: [copy Text any Table_Printable^ (insert tail Table_Row compose [td (Text)])] Table_Row^: [ (Table_Row: copy []) #"|" some [Table_Cell^ #"|"] opt #"|" LWS? Line_End ( insert tail Table compose [tr [(Table_Row)]] Table_Row: none ) ] Table^: [ (Table: copy []) some Table_Row^ ( Accrete [table [tbody [(Table)]]] ) ] As can be seen, I'd really like to make "Table_" into a sort of object or function, rather than "fake" it with the arrangement of names. Any ideas? Andrew J Martin ICQ: 26227169