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

[REBOL] Parsing question

From: gilette:echo at: 14-Apr-2003 12:15

Hello, I have a parsing question. I am trying to parse a string of PGN format. it is the formalize way to notee a chess game, for those who don't know. I want to explicitly say that the space or the newline can end some sub-pattern. But i have an error message if i use the commented line below... Any idea ? Is there a smarter way of doing this ? digit: charset [#"0" - #"9"] spacer: #" " ;--- spacer: [#" " | #"^/"] <-- does not work round_number: [copy x some digit #"." (print join "tour=" x)] round_played: [copy y to spacer (print join "played=" y)] round_comment: [#"{" copy comm to #"}" (print comm) to spacer] round: [round_number round_played round_played opt round_comment] game: [some round] rules: [game to end] parse "1.d3 d5 2.Nf3 Nf6 3.Bd2 c5 4.g3 Nc6 {a comment} 5.Na3 e6 6.b3 Be7" rules Thank you ! -- Serge Gilette ------------------------- 04 92 28 32 50