Lexer states without explicit terminators?

187 views
Skip to first unread message

Austin Hastings

unread,
Jul 7, 2015, 5:38:02 PM7/7/15
to ply-...@googlegroups.com
Howdy,

I'm trying to parse numbers using lexer states, and there aren't any
explicit ending delimiters. Instead, I was hoping to rely on the t_*_error
functions to wrap up my token.

It turns out, though, that the error handler will raise an error if the
lexpos doesn't change. So I can't simply let t_error find the next non-matching
character, wrap up my token, and change parser state back to something else.

Is this a bug?

If not, is there a generally accepted way to deal with the case where a
state doesn't end because of a visible delimiter, but simply because it
transitions somewhere else?

aTdHvAaNnKcSe,

=Austin
Reply all
Reply to author
Forward
0 new messages