bug1390174.re

来自「a little DFA compiler.」· RE 代码 · 共 43 行

RE
43
字号
#include <stdlib.h>#include <stdio.h>#include <string.h>#define RET(n) return nint scan(const char *s, int l) {const char *p = s;const char *q;#define YYCTYPE         char#define YYCURSOR        p#define YYLIMIT         (s+l)#define YYMARKER        q#define YYFILL(n)/*!re2c	any     = [\000-\377];	'a'{0,}"\n"     {RET(1);}	any             {RET(0);}*/}void _do_scan(int exp, const char * str, int len){	int ret = scan(str, len);		printf("%d %s %d\n", exp, exp == ret ? "==" : "!=", ret);}#define do_scan(exp, str) _do_scan(exp, str, sizeof(str) - 1)main(){	do_scan(1, "a\n");	do_scan(1, "aa\n");	do_scan(1, "aaa\n");	do_scan(1, "aaaa\n");	do_scan(1, "\n");	do_scan(0, "q");	do_scan(0, "a");}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?