Question about repetition of nested rules #37

seeflanigan opened this Issue Dec 22, 2011 · 1 comment


None yet

2 participants


In trying to use the following rule

rule metadata_body
  timestamp server_id end_pos word (space | number | ":")* "\n"

to parse the line

"#111215 10:45:17 server id 6001  end_log_pos 363693   Write_rows: table id 3694656 flags: STMT_END_F\n"

the call to #parse hangs indefinitely, making it seem like I've caused an infinite loop somewhere.

Being new to Citrus and rather new to PEGs altogether, I'm sure there's some foolish newbie mistake at play here.

What I'm trying to express is "match any word, space, number, or colon, up to the newline character."

Can someone point me toward A Better Way™?


Would you please post the full grammar (or at least all the relevant bits) to the citrus-users Google Group? The problem may lie somewhere in how you've defined space, number, or word.

@mjackson mjackson closed this Dec 29, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment