/* Generated by re2c */ #line 1 "unicode_group_Zp.u--encoding-policy(fail).re" #include #define YYCTYPE unsigned int bool scan(const YYCTYPE * start, const YYCTYPE * const limit) { __attribute__((unused)) const YYCTYPE * YYMARKER; // silence compiler warnings when YYMARKER is not used # define YYCURSOR start Zp: #line 13 "unicode_group_Zp.u--encoding-policy(fail).c" { YYCTYPE yych; yych = *YYCURSOR; if (yych == 0x00002029) goto yy4; ++YYCURSOR; #line 13 "unicode_group_Zp.u--encoding-policy(fail).re" { return YYCURSOR == limit; } #line 21 "unicode_group_Zp.u--encoding-policy(fail).c" yy4: ++YYCURSOR; #line 12 "unicode_group_Zp.u--encoding-policy(fail).re" { goto Zp; } #line 26 "unicode_group_Zp.u--encoding-policy(fail).c" } #line 14 "unicode_group_Zp.u--encoding-policy(fail).re" } static const unsigned int chars_Zp [] = {0x2029,0x2029, 0x0,0x0}; static unsigned int encode_utf32 (const unsigned int * ranges, unsigned int ranges_count, unsigned int * s) { unsigned int * const s_start = s; for (unsigned int i = 0; i < ranges_count; i += 2) for (unsigned int j = ranges[i]; j <= ranges[i + 1]; ++j) *s++ = j; return s - s_start; } int main () { YYCTYPE * buffer_Zp = new YYCTYPE [2]; unsigned int buffer_len = encode_utf32 (chars_Zp, sizeof (chars_Zp) / sizeof (unsigned int), buffer_Zp); if (!scan (reinterpret_cast (buffer_Zp), reinterpret_cast (buffer_Zp + buffer_len))) printf("test 'Zp' failed\n"); delete [] buffer_Zp; return 0; }