[ragel] EOF actions question
Will Dowling
will at autodeist.com
Sun Oct 22 14:12:47 UTC 2017
Hi folks,
I’m a newcomer to ragel and was hoping someone can help me better understand when actions execute.
Specifically, I’m not sure why an EOF final state action is not firing.
Here’s a self-contained example of what I’m trying to achieve:
https://gist.github.com/dowlingw/39953db1b166003c1474fa10a20616de
In the example, I’m keeping track of the character pointer to extract the token when the machine is finished.
This is modelled around how I’ve seen it done elsewhere, but maybe there’s a better way.
From my understanding from the guide and looking at the graphviz output:
%capture would never fire because the machine is at EOF, so never exits the userid machine
@capture will work, but will execute every character the userid machine processes
%/capture should(?) fire because the machine is in the userid state when it reaches EOF
But the last one doesn’t appear to work the way I’d expect - so I’m probably misunderstanding things.
If anyone is able to point me in the right direction, I’d be super grateful.
(On the unlikely chance it’s something environmental, I’m running Ragel 6.10 on go1.8.3 darwin/amd64)
In either case, thanks for maintaining an awesome tool!
Cheers :)
Will Dowling
E: will at autodeist.com
More information about the ragel-users
mailing list