Hi, I've read the ragel manual a couple of times and searched the mailing list and I couldn't find the solution to this problem. I imagine the solution is there somewhere, but I couldn't find it since I couldn't search the mailing list archive properly.<div>
<br></div><div>BTW, I don't really need to parse c comments, but I found this example to match perfectly what I am trying to accomplish. I'm really trying to parse and print data separated by a multi-character token.</div>
<div><br></div><div>Page 29 of Ragel 6.7 manual shows an example on how to properly parse C language comments, but the action @comm also parses the * caracter at the ending "*/" as shown in the Graphviz image.</div>
<div><br></div><div>I tried many ways to solve this problem, but I couldn't do it. Can someone help?</div><div><br></div><div>action comm { printf("%c", fc); }</div><div>p = "/* foo *** bar */";</div>
<div><br></div><div>I tried:</div><div><br></div><div>main := '/*' (any* -- '/*')@comm '*/';</div><div>main := '/*' any*@comm :>> '*/';</div><div><div>main := '/*' ( ( any @comm )* - ( any* '*/' any* ) ) '*/';</div>
</div><div><br></div><div>But it always prints: "foo *** bar *" (note the * at the end) and I looking for a way for it to print just " foo *** bar ".</div><div><br></div><div>Is there an easy way to fix this?</div>
<div><br></div><div><br></div><div>Thanks in advance!</div>