Basic ragel test that can parse 1 ASNI sequence and do nothing with it.
This commit is contained in:
parent
4162287841
commit
753bc70b77
5 changed files with 227 additions and 1 deletions
29
scratchpad/testragel.rl
Normal file
29
scratchpad/testragel.rl
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include <fmt/core.h>
|
||||
|
||||
using namespace fmt;
|
||||
|
||||
%%{
|
||||
machine foo;
|
||||
main :=
|
||||
0x1B "["
|
||||
[0-9]+ @{ println("NUM1"); }
|
||||
";"
|
||||
[0-9]+ @{ println("NUM2"); }
|
||||
"m"
|
||||
0 @{ res = 1; };
|
||||
}%%
|
||||
|
||||
%% write data;
|
||||
|
||||
int main() {
|
||||
int cs, res = 0;
|
||||
char *test = "\x1B[36;46m";
|
||||
|
||||
char *p = test;
|
||||
char *pe = p + strlen(p) + 1;
|
||||
%% write init;
|
||||
%% write exec;
|
||||
|
||||
fmt::println("result = {}", res);
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue