You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
421 B
30 lines
421 B
4 weeks ago
|
#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;
|
||
|
}
|