It looks like the regex in category
is advancing through the white space needed to match category_line
... do this:
rule category
("/" [^/\s]+)+ # or perhaps ("/" [^/\n]+)+
end
(And, wow, a Treetop question. This is number 47 in the history of SO and its 4 million total questions. One in 87,000 SO questions are tagged Treetop).