[ragel-users] Testing beginning of line in a scanner
thurs... at cs.queensu.ca
Sun Jun 1 12:12:03 PDT 2008
Hey Mitchell, I just checked in a fix for this. Also, you might want to
try "when !starts_line" to enforce the negative sense of a condition.
This will prevent not_starts_line from being executed right after
starts_line to get the same info only negated.
> I'm trying to test for a character that occurs only at the beginning
> of a line in a scanner:
> special = '!' when starts_line @callback;
> line := |*
> [\t ]+ => callback;
> newline => callback;
> '!' when not_starts_line => callback;
> ^(space | '!') => callback;
> I get a
> ragel: fsmgraph.h:385: TransAp::TransAp(const TransAp&): Assertion
> `lmActionTable.length() == 0 && other.lmActionTable.length() == 0'
> If I remove the "'!' when not_starts_line" line, Ragel compiles, but I
> cannot detect any '!'s in a place other than the beginning of a line
> which is no good.
> Any ideas?
More information about the ragel-users