#line 1 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" #include #include #if defined(_WIN32) #include #endif #ifdef HAVE_RUBY_RE_H #include #else #include #endif #ifdef HAVE_RUBY_ENCODING_H #include #define ENCODED_STR_NEW(ptr, len) \ rb_enc_str_new(ptr, len, rb_utf8_encoding()) #else #define ENCODED_STR_NEW(ptr, len) \ rb_str_new(ptr, len) #endif #define LF_FLAG 0 #define CRLF_FLAG 1 #define LF "\n" #define CRLF "\r\n" #ifndef RSTRING_PTR #define RSTRING_PTR(s) (RSTRING(s)->ptr) #endif #ifndef RSTRING_LEN #define RSTRING_LEN(s) (RSTRING(s)->len) #endif #define DATA_GET(FROM, TYPE, NAME) \ Data_Get_Struct(FROM, TYPE, NAME); \ if (NAME == NULL) { \ rb_raise(rb_eArgError, "NULL found for " # NAME " when it shouldn't be."); \ } typedef struct lexer_state { int content_len; int line_number; int current_line; int start_col; int eol; size_t mark; size_t keyword_start; size_t keyword_end; size_t next_keyword_start; size_t content_start; size_t content_end; size_t query_start; size_t last_newline; size_t final_newline; } lexer_state; static VALUE mGherkin; static VALUE mCLexer; static VALUE cI18nLexer; static VALUE rb_eGherkinLexingError; #define LEN(AT, P) (P - data - lexer->AT) #define MARK(M, P) (lexer->M = (P) - data) #define PTR_TO(P) (data + lexer->P) #define STORE_KW_END_CON(EVENT) \ store_multiline_kw_con(listener, # EVENT, \ PTR_TO(keyword_start), LEN(keyword_start, PTR_TO(keyword_end - 1)), \ PTR_TO(content_start), LEN(content_start, PTR_TO(content_end)), \ lexer->current_line, lexer->eol); \ if (lexer->content_end != 0) { \ p = PTR_TO(content_end - 1); \ } \ lexer->content_end = 0 #define STORE_ATTR(ATTR) \ store_attr(listener, # ATTR, \ PTR_TO(content_start), LEN(content_start, p), \ lexer->line_number) #line 239 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" /** Data **/ #line 92 "ext/gherkin_lexer_pl/gherkin_lexer_pl.c" static const char _lexer_actions[] = { 0, 1, 0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 1, 11, 1, 14, 1, 15, 1, 16, 1, 17, 1, 18, 1, 19, 1, 20, 1, 21, 2, 1, 16, 2, 11, 0, 2, 12, 13, 2, 15, 0, 2, 15, 2, 2, 15, 14, 2, 15, 17, 2, 16, 4, 2, 16, 5, 2, 16, 6, 2, 16, 7, 2, 16, 8, 2, 16, 14, 2, 18, 19, 2, 20, 0, 2, 20, 2, 2, 20, 14, 2, 20, 17, 3, 3, 12, 13, 3, 9, 12, 13, 3, 10, 12, 13, 3, 11, 12, 13, 3, 12, 13, 16, 3, 15, 12, 13, 4, 1, 12, 13, 16, 4, 15, 0, 12, 13 }; static const short _lexer_key_offsets[] = { 0, 0, 18, 19, 20, 37, 38, 39, 43, 48, 53, 58, 63, 67, 71, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 92, 97, 104, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 184, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251, 253, 255, 257, 259, 261, 263, 266, 268, 270, 272, 274, 276, 278, 280, 282, 284, 286, 288, 290, 292, 294, 296, 298, 300, 302, 304, 306, 308, 310, 312, 314, 316, 318, 321, 323, 325, 327, 329, 331, 333, 335, 337, 339, 341, 343, 345, 347, 349, 351, 353, 356, 358, 360, 362, 364, 366, 368, 370, 372, 374, 376, 378, 380, 382, 384, 386, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 422, 424, 426, 428, 430, 432, 434, 436, 438, 440, 442, 444, 446, 448, 450, 452, 454, 456, 458, 460, 462, 464, 466, 468, 470, 472, 474, 476, 478, 480, 482, 484, 486, 488, 490, 492, 494, 497, 499, 501, 503, 505, 507, 509, 511, 513, 515, 517, 519, 521, 523, 525, 527, 529, 531, 533, 535, 537, 539, 541, 543, 545, 547, 549, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 577, 579, 581, 583, 585, 587, 589, 591, 593, 595, 597, 599, 601, 603, 605, 607, 609, 611, 613, 615, 617, 619, 621, 623, 625, 628, 630, 632, 634, 636, 638, 640, 642, 644, 646, 648, 650, 652, 654, 656, 658, 660, 662, 664, 666, 668, 670, 672, 674, 676, 678, 680, 682, 684, 686, 688, 690, 692, 694, 696, 698, 700, 702, 704, 706, 708, 710, 712, 714, 716, 718, 720, 722, 723, 724, 725, 726, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 753, 755, 757, 759, 761, 763, 765, 767, 769, 771, 773, 775, 777, 779, 781, 783, 785, 787, 789, 791, 793, 795, 797, 799, 801, 803, 805, 808, 810, 812, 814, 816, 818, 820, 822, 824, 826, 828, 830, 832, 834, 836, 838, 840, 842, 844, 846, 848, 850, 852, 854, 856, 858, 860, 863, 865, 867, 869, 871, 873, 875, 877, 879, 881, 883, 885, 887, 889, 891, 893, 895, 897, 899, 901, 903, 905, 907, 909, 911, 913, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 928, 934, 937, 939, 945, 962 }; static const char _lexer_trans_keys[] = { -17, 10, 32, 34, 35, 37, 42, 64, 65, 74, 79, 80, 83, 87, 90, 124, 9, 13, -69, -65, 10, 32, 34, 35, 37, 42, 64, 65, 74, 79, 80, 83, 87, 90, 124, 9, 13, 34, 34, 10, 32, 9, 13, 10, 32, 34, 9, 13, 10, 32, 34, 9, 13, 10, 32, 34, 9, 13, 10, 32, 34, 9, 13, 10, 32, 9, 13, 10, 32, 9, 13, 10, 13, 10, 95, 70, 69, 65, 84, 85, 82, 69, 95, 69, 78, 68, 95, 37, 32, 10, 10, 13, 13, 32, 64, 9, 10, 9, 10, 13, 32, 64, 11, 12, 10, 32, 64, 9, 13, 108, 101, 101, -59, -68, 101, 108, 105, 114, 97, 122, 114, 122, 121, 107, -59, -126, 97, 100, 121, 58, 10, 10, 10, 32, 35, 87, 124, 9, 13, -59, 10, -126, 10, 10, 97, -59, 10, -101, 10, 10, 99, 10, 105, 10, 119, 10, 111, -59, 10, -101, 10, -60, 10, -121, 10, 10, 58, 10, 32, 34, 35, 37, 42, 64, 65, 74, 79, 80, 83, 87, 90, 124, 9, 13, 99, 122, 101, 110, 97, 114, 105, 117, 115, 122, 58, 10, 10, 10, 32, 35, 37, 42, 64, 65, 74, 79, 83, 87, 90, 9, 13, 10, 95, 10, 70, 10, 69, 10, 65, 10, 84, 10, 85, 10, 82, 10, 69, 10, 95, 10, 69, 10, 78, 10, 68, 10, 95, 10, 37, 10, 32, 10, 108, 10, 101, 10, 101, -59, 10, -68, 10, 10, 101, 10, 108, 10, 105, 10, 114, 10, 97, 10, 122, 10, 99, 122, 10, 101, 10, 110, 10, 97, 10, 114, 10, 105, 10, 117, 10, 115, 10, 122, 10, 58, 10, 97, 10, 98, 10, 108, 10, 111, 10, 110, 10, 32, 10, 115, 10, 99, 10, 101, 10, 110, 10, 97, 10, 114, 10, 105, 10, 117, 10, 115, 10, 122, 10, 97, -59, 10, 116, -126, 10, 10, 97, -59, 10, -101, 10, 10, 99, 10, 105, 10, 119, 10, 111, -59, 10, -101, 10, -60, 10, -121, 10, 10, 101, 10, 100, 10, 121, 10, 97, -59, 10, 107, -126, 10, 10, 111, -59, 10, -68, 10, 10, 101, 10, 110, 10, 105, -59, 10, -126, 10, 10, 97, 10, 100, 10, 97, 10, 106, -60, 10, -123, 10, 10, 99, 97, 98, 108, 111, 110, 32, 115, 99, 101, 110, 97, 114, 105, 117, 115, 122, 97, 58, 10, 10, 10, 32, 35, 37, 42, 64, 65, 74, 79, 83, 87, 90, 9, 13, 10, 95, 10, 70, 10, 69, 10, 65, 10, 84, 10, 85, 10, 82, 10, 69, 10, 95, 10, 69, 10, 78, 10, 68, 10, 95, 10, 37, 10, 32, 10, 108, 10, 101, 10, 101, -59, 10, -68, 10, 10, 101, 10, 108, 10, 105, 10, 114, 10, 97, 10, 122, 10, 99, 10, 101, 10, 110, 10, 97, 10, 114, 10, 105, 10, 117, 10, 115, 10, 122, 10, 58, -59, 10, 116, -126, 10, 10, 97, -59, 10, -101, 10, 10, 99, 10, 105, 10, 119, 10, 111, -59, 10, -101, 10, -60, 10, -121, 10, 10, 101, 10, 100, 10, 121, 10, 97, 10, 107, -59, 10, -126, 10, 10, 97, 10, 100, 10, 97, 10, 106, -60, 10, -123, 10, 10, 99, -59, 116, -126, 97, -59, -101, 99, 105, 119, 111, -59, -101, -60, -121, 58, 10, 10, 10, 32, 35, 37, 64, 80, 83, 87, 90, 9, 13, 10, 95, 10, 70, 10, 69, 10, 65, 10, 84, 10, 85, 10, 82, 10, 69, 10, 95, 10, 69, 10, 78, 10, 68, 10, 95, 10, 37, 10, 114, 10, 122, 10, 121, 10, 107, -59, 10, -126, 10, 10, 97, 10, 100, 10, 121, 10, 58, 10, 99, 122, 10, 101, 10, 110, 10, 97, 10, 114, 10, 105, 10, 117, 10, 115, 10, 122, 10, 97, 10, 98, 10, 108, 10, 111, 10, 110, 10, 32, 10, 115, 10, 99, 10, 101, 10, 110, 10, 97, 10, 114, 10, 105, 10, 117, 10, 115, 10, 122, 10, 97, -59, 10, -126, 10, 10, 97, -59, 10, -101, 10, 10, 99, 10, 105, 10, 119, 10, 111, -59, 10, -101, 10, -60, 10, -121, 10, 10, 97, -59, 10, -126, 10, 10, 111, -59, 10, -68, 10, 10, 101, 10, 110, 10, 105, 101, 100, 121, 97, -59, 107, -126, 111, -59, -68, 101, 110, 105, 97, 58, 10, 10, 10, 32, 35, 37, 42, 64, 65, 74, 79, 83, 87, 90, 9, 13, 10, 95, 10, 70, 10, 69, 10, 65, 10, 84, 10, 85, 10, 82, 10, 69, 10, 95, 10, 69, 10, 78, 10, 68, 10, 95, 10, 37, 10, 32, 10, 108, 10, 101, 10, 101, -59, 10, -68, 10, 10, 101, 10, 108, 10, 105, 10, 114, 10, 97, 10, 122, 10, 99, 122, 10, 101, 10, 110, 10, 97, 10, 114, 10, 105, 10, 117, 10, 115, 10, 122, 10, 58, 10, 97, 10, 98, 10, 108, 10, 111, 10, 110, 10, 32, 10, 115, 10, 99, 10, 101, 10, 110, 10, 97, 10, 114, 10, 105, 10, 117, 10, 115, 10, 122, 10, 97, -59, 10, 116, -126, 10, 10, 97, -59, 10, -101, 10, 10, 99, 10, 105, 10, 119, 10, 111, -59, 10, -101, 10, -60, 10, -121, 10, 10, 101, 10, 100, 10, 121, 10, 97, 10, 107, -59, 10, -126, 10, 10, 97, 10, 100, 10, 97, 10, 106, -60, 10, -123, 10, 10, 99, -59, -126, 97, 100, 97, 106, -60, -123, 99, 32, 124, 9, 13, 10, 32, 92, 124, 9, 13, 10, 92, 124, 10, 92, 10, 32, 92, 124, 9, 13, 10, 32, 34, 35, 37, 42, 64, 65, 74, 79, 80, 83, 87, 90, 124, 9, 13, 0 }; static const char _lexer_single_lengths[] = { 0, 16, 1, 1, 15, 1, 1, 2, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 5, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 15, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 12, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 3, 2, 4, 15, 0 }; static const char _lexer_range_lengths[] = { 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0 }; static const short _lexer_index_offsets[] = { 0, 0, 18, 20, 22, 39, 41, 43, 47, 52, 57, 62, 67, 71, 75, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 115, 120, 127, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 185, 188, 191, 194, 197, 200, 203, 206, 209, 212, 215, 218, 221, 224, 227, 244, 247, 249, 251, 253, 255, 257, 259, 261, 263, 265, 267, 269, 283, 286, 289, 292, 295, 298, 301, 304, 307, 310, 313, 316, 319, 322, 325, 328, 331, 334, 337, 340, 343, 346, 349, 352, 355, 358, 361, 365, 368, 371, 374, 377, 380, 383, 386, 389, 392, 395, 398, 401, 404, 407, 410, 413, 416, 419, 422, 425, 428, 431, 434, 437, 440, 443, 447, 450, 453, 456, 459, 462, 465, 468, 471, 474, 477, 480, 483, 486, 489, 492, 495, 499, 502, 505, 508, 511, 514, 517, 520, 523, 526, 529, 532, 535, 538, 541, 544, 547, 549, 551, 553, 555, 557, 559, 561, 563, 565, 567, 569, 571, 573, 575, 577, 579, 581, 583, 585, 587, 601, 604, 607, 610, 613, 616, 619, 622, 625, 628, 631, 634, 637, 640, 643, 646, 649, 652, 655, 658, 661, 664, 667, 670, 673, 676, 679, 682, 685, 688, 691, 694, 697, 700, 703, 706, 709, 713, 716, 719, 722, 725, 728, 731, 734, 737, 740, 743, 746, 749, 752, 755, 758, 761, 764, 767, 770, 773, 776, 779, 782, 785, 788, 791, 794, 796, 798, 800, 802, 804, 806, 808, 810, 812, 814, 816, 818, 820, 822, 824, 835, 838, 841, 844, 847, 850, 853, 856, 859, 862, 865, 868, 871, 874, 877, 880, 883, 886, 889, 892, 895, 898, 901, 904, 907, 911, 914, 917, 920, 923, 926, 929, 932, 935, 938, 941, 944, 947, 950, 953, 956, 959, 962, 965, 968, 971, 974, 977, 980, 983, 986, 989, 992, 995, 998, 1001, 1004, 1007, 1010, 1013, 1016, 1019, 1022, 1025, 1028, 1031, 1034, 1037, 1040, 1043, 1046, 1049, 1052, 1054, 1056, 1058, 1060, 1063, 1065, 1067, 1069, 1071, 1073, 1075, 1077, 1079, 1081, 1083, 1085, 1099, 1102, 1105, 1108, 1111, 1114, 1117, 1120, 1123, 1126, 1129, 1132, 1135, 1138, 1141, 1144, 1147, 1150, 1153, 1156, 1159, 1162, 1165, 1168, 1171, 1174, 1177, 1181, 1184, 1187, 1190, 1193, 1196, 1199, 1202, 1205, 1208, 1211, 1214, 1217, 1220, 1223, 1226, 1229, 1232, 1235, 1238, 1241, 1244, 1247, 1250, 1253, 1256, 1259, 1263, 1266, 1269, 1272, 1275, 1278, 1281, 1284, 1287, 1290, 1293, 1296, 1299, 1302, 1305, 1308, 1311, 1314, 1317, 1320, 1323, 1326, 1329, 1332, 1335, 1338, 1341, 1343, 1345, 1347, 1349, 1351, 1353, 1355, 1357, 1359, 1363, 1369, 1373, 1376, 1382, 1399 }; static const short _lexer_trans_targs[] = { 2, 4, 4, 5, 14, 16, 30, 33, 36, 38, 44, 47, 75, 259, 351, 454, 4, 0, 3, 0, 4, 0, 4, 4, 5, 14, 16, 30, 33, 36, 38, 44, 47, 75, 259, 351, 454, 4, 0, 6, 0, 7, 0, 8, 7, 7, 0, 9, 9, 10, 9, 9, 9, 9, 10, 9, 9, 9, 9, 11, 9, 9, 9, 9, 12, 9, 9, 4, 13, 13, 0, 4, 13, 13, 0, 4, 15, 14, 4, 0, 17, 0, 18, 0, 19, 0, 20, 0, 21, 0, 22, 0, 23, 0, 24, 0, 25, 0, 26, 0, 27, 0, 28, 0, 29, 0, 460, 0, 31, 0, 0, 32, 4, 15, 32, 0, 0, 0, 0, 34, 35, 4, 35, 35, 33, 34, 34, 4, 35, 33, 35, 0, 37, 0, 30, 0, 39, 0, 40, 0, 41, 0, 42, 0, 43, 0, 30, 0, 45, 0, 46, 0, 30, 0, 48, 0, 49, 0, 50, 0, 51, 0, 52, 0, 53, 0, 54, 0, 55, 0, 56, 0, 57, 0, 59, 58, 59, 58, 59, 59, 4, 60, 4, 59, 58, 61, 59, 58, 62, 59, 58, 59, 63, 58, 64, 59, 58, 65, 59, 58, 59, 66, 58, 59, 67, 58, 59, 68, 58, 59, 69, 58, 70, 59, 58, 71, 59, 58, 72, 59, 58, 73, 59, 58, 59, 74, 58, 4, 4, 5, 14, 16, 30, 33, 36, 38, 44, 47, 75, 259, 351, 454, 4, 0, 76, 175, 0, 77, 0, 78, 0, 79, 0, 80, 0, 81, 0, 82, 0, 83, 0, 84, 0, 85, 0, 87, 86, 87, 86, 87, 87, 4, 88, 102, 4, 103, 105, 111, 114, 141, 157, 87, 86, 87, 89, 86, 87, 90, 86, 87, 91, 86, 87, 92, 86, 87, 93, 86, 87, 94, 86, 87, 95, 86, 87, 96, 86, 87, 97, 86, 87, 98, 86, 87, 99, 86, 87, 100, 86, 87, 101, 86, 87, 4, 86, 87, 74, 86, 87, 104, 86, 87, 102, 86, 87, 106, 86, 107, 87, 86, 108, 87, 86, 87, 109, 86, 87, 110, 86, 87, 102, 86, 87, 112, 86, 87, 113, 86, 87, 102, 86, 87, 115, 124, 86, 87, 116, 86, 87, 117, 86, 87, 118, 86, 87, 119, 86, 87, 120, 86, 87, 121, 86, 87, 122, 86, 87, 123, 86, 87, 74, 86, 87, 125, 86, 87, 126, 86, 87, 127, 86, 87, 128, 86, 87, 129, 86, 87, 130, 86, 87, 131, 86, 87, 132, 86, 87, 133, 86, 87, 134, 86, 87, 135, 86, 87, 136, 86, 87, 137, 86, 87, 138, 86, 87, 139, 86, 87, 140, 86, 87, 123, 86, 142, 87, 154, 86, 143, 87, 86, 87, 144, 86, 145, 87, 86, 146, 87, 86, 87, 147, 86, 87, 148, 86, 87, 149, 86, 87, 150, 86, 151, 87, 86, 152, 87, 86, 153, 87, 86, 123, 87, 86, 87, 155, 86, 87, 156, 86, 87, 102, 86, 87, 158, 86, 159, 87, 166, 86, 160, 87, 86, 87, 161, 86, 162, 87, 86, 163, 87, 86, 87, 164, 86, 87, 165, 86, 87, 140, 86, 167, 87, 86, 168, 87, 86, 87, 169, 86, 87, 170, 86, 87, 171, 86, 87, 172, 86, 173, 87, 86, 174, 87, 86, 87, 102, 86, 176, 0, 177, 0, 178, 0, 179, 0, 180, 0, 181, 0, 182, 0, 183, 0, 184, 0, 185, 0, 186, 0, 187, 0, 188, 0, 189, 0, 190, 0, 191, 0, 192, 0, 193, 0, 195, 194, 195, 194, 195, 195, 4, 196, 210, 4, 211, 213, 219, 222, 232, 248, 195, 194, 195, 197, 194, 195, 198, 194, 195, 199, 194, 195, 200, 194, 195, 201, 194, 195, 202, 194, 195, 203, 194, 195, 204, 194, 195, 205, 194, 195, 206, 194, 195, 207, 194, 195, 208, 194, 195, 209, 194, 195, 4, 194, 195, 74, 194, 195, 212, 194, 195, 210, 194, 195, 214, 194, 215, 195, 194, 216, 195, 194, 195, 217, 194, 195, 218, 194, 195, 210, 194, 195, 220, 194, 195, 221, 194, 195, 210, 194, 195, 223, 194, 195, 224, 194, 195, 225, 194, 195, 226, 194, 195, 227, 194, 195, 228, 194, 195, 229, 194, 195, 230, 194, 195, 231, 194, 195, 74, 194, 233, 195, 245, 194, 234, 195, 194, 195, 235, 194, 236, 195, 194, 237, 195, 194, 195, 238, 194, 195, 239, 194, 195, 240, 194, 195, 241, 194, 242, 195, 194, 243, 195, 194, 244, 195, 194, 231, 195, 194, 195, 246, 194, 195, 247, 194, 195, 210, 194, 195, 249, 194, 195, 250, 194, 251, 195, 194, 252, 195, 194, 195, 253, 194, 195, 254, 194, 195, 255, 194, 195, 256, 194, 257, 195, 194, 258, 195, 194, 195, 210, 194, 260, 348, 0, 261, 0, 262, 0, 263, 0, 264, 0, 265, 0, 266, 0, 267, 0, 268, 0, 269, 0, 270, 0, 271, 0, 272, 0, 273, 0, 275, 274, 275, 274, 275, 275, 4, 276, 4, 290, 300, 326, 339, 275, 274, 275, 277, 274, 275, 278, 274, 275, 279, 274, 275, 280, 274, 275, 281, 274, 275, 282, 274, 275, 283, 274, 275, 284, 274, 275, 285, 274, 275, 286, 274, 275, 287, 274, 275, 288, 274, 275, 289, 274, 275, 4, 274, 275, 291, 274, 275, 292, 274, 275, 293, 274, 275, 294, 274, 295, 275, 274, 296, 275, 274, 275, 297, 274, 275, 298, 274, 275, 299, 274, 275, 74, 274, 275, 301, 309, 274, 275, 302, 274, 275, 303, 274, 275, 304, 274, 275, 305, 274, 275, 306, 274, 275, 307, 274, 275, 308, 274, 275, 299, 274, 275, 310, 274, 275, 311, 274, 275, 312, 274, 275, 313, 274, 275, 314, 274, 275, 315, 274, 275, 316, 274, 275, 317, 274, 275, 318, 274, 275, 319, 274, 275, 320, 274, 275, 321, 274, 275, 322, 274, 275, 323, 274, 275, 324, 274, 275, 325, 274, 275, 299, 274, 327, 275, 274, 328, 275, 274, 275, 329, 274, 330, 275, 274, 331, 275, 274, 275, 332, 274, 275, 333, 274, 275, 334, 274, 275, 335, 274, 336, 275, 274, 337, 275, 274, 338, 275, 274, 299, 275, 274, 275, 340, 274, 341, 275, 274, 342, 275, 274, 275, 343, 274, 344, 275, 274, 345, 275, 274, 275, 346, 274, 275, 347, 274, 275, 325, 274, 349, 0, 350, 0, 30, 0, 352, 0, 353, 445, 0, 354, 0, 355, 0, 356, 0, 357, 0, 358, 0, 359, 0, 360, 0, 361, 0, 362, 0, 364, 363, 364, 363, 364, 364, 4, 365, 379, 4, 380, 382, 388, 391, 418, 434, 364, 363, 364, 366, 363, 364, 367, 363, 364, 368, 363, 364, 369, 363, 364, 370, 363, 364, 371, 363, 364, 372, 363, 364, 373, 363, 364, 374, 363, 364, 375, 363, 364, 376, 363, 364, 377, 363, 364, 378, 363, 364, 4, 363, 364, 74, 363, 364, 381, 363, 364, 379, 363, 364, 383, 363, 384, 364, 363, 385, 364, 363, 364, 386, 363, 364, 387, 363, 364, 379, 363, 364, 389, 363, 364, 390, 363, 364, 379, 363, 364, 392, 401, 363, 364, 393, 363, 364, 394, 363, 364, 395, 363, 364, 396, 363, 364, 397, 363, 364, 398, 363, 364, 399, 363, 364, 400, 363, 364, 74, 363, 364, 402, 363, 364, 403, 363, 364, 404, 363, 364, 405, 363, 364, 406, 363, 364, 407, 363, 364, 408, 363, 364, 409, 363, 364, 410, 363, 364, 411, 363, 364, 412, 363, 364, 413, 363, 364, 414, 363, 364, 415, 363, 364, 416, 363, 364, 417, 363, 364, 400, 363, 419, 364, 431, 363, 420, 364, 363, 364, 421, 363, 422, 364, 363, 423, 364, 363, 364, 424, 363, 364, 425, 363, 364, 426, 363, 364, 427, 363, 428, 364, 363, 429, 364, 363, 430, 364, 363, 400, 364, 363, 364, 432, 363, 364, 433, 363, 364, 379, 363, 364, 435, 363, 364, 436, 363, 437, 364, 363, 438, 364, 363, 364, 439, 363, 364, 440, 363, 364, 441, 363, 364, 442, 363, 443, 364, 363, 444, 364, 363, 364, 379, 363, 446, 0, 447, 0, 448, 0, 449, 0, 450, 0, 451, 0, 452, 0, 453, 0, 30, 0, 454, 455, 454, 0, 459, 458, 457, 455, 458, 456, 0, 457, 455, 456, 0, 457, 456, 459, 458, 457, 455, 458, 456, 459, 459, 5, 14, 16, 30, 33, 36, 38, 44, 47, 75, 259, 351, 454, 459, 0, 0, 0 }; static const char _lexer_trans_actions[] = { 0, 47, 0, 5, 1, 0, 25, 1, 25, 25, 25, 25, 25, 25, 25, 31, 0, 39, 0, 39, 0, 39, 47, 0, 5, 1, 0, 25, 1, 25, 25, 25, 25, 25, 25, 25, 31, 0, 39, 0, 39, 0, 39, 47, 0, 0, 39, 119, 41, 41, 41, 3, 111, 29, 29, 29, 0, 111, 29, 29, 29, 0, 111, 29, 0, 29, 0, 95, 7, 7, 39, 47, 0, 0, 39, 103, 21, 0, 47, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 39, 50, 99, 19, 0, 39, 39, 39, 39, 0, 23, 107, 23, 23, 44, 23, 0, 47, 0, 1, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 124, 50, 47, 0, 47, 0, 74, 77, 74, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 47, 17, 0, 115, 27, 53, 50, 27, 56, 50, 56, 56, 56, 56, 56, 56, 56, 59, 27, 39, 0, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 124, 50, 47, 0, 47, 0, 68, 29, 77, 68, 77, 77, 77, 77, 77, 77, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 13, 0, 47, 13, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 13, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 0, 47, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 0, 47, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 124, 50, 47, 0, 47, 0, 71, 29, 77, 71, 77, 77, 77, 77, 77, 77, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 15, 0, 47, 15, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 15, 0, 0, 47, 0, 0, 0, 47, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 0, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 124, 50, 47, 0, 47, 0, 62, 29, 62, 77, 77, 77, 77, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 9, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 9, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 39, 0, 39, 0, 39, 0, 39, 0, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 124, 50, 47, 0, 47, 0, 65, 29, 77, 65, 77, 77, 77, 77, 77, 77, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 11, 0, 47, 11, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 11, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 0, 47, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 47, 0, 0, 0, 47, 0, 0, 47, 0, 47, 0, 0, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 39, 0, 0, 0, 39, 47, 33, 33, 80, 33, 33, 39, 0, 35, 0, 39, 0, 0, 47, 0, 0, 35, 0, 0, 47, 0, 86, 83, 37, 89, 83, 89, 89, 89, 89, 89, 89, 89, 92, 0, 39, 0, 0 }; static const char _lexer_eof_actions[] = { 0, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39 }; static const int lexer_start = 1; static const int lexer_first_final = 460; static const int lexer_error = 0; static const int lexer_en_main = 1; #line 243 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" static VALUE strip_i(VALUE str, VALUE ary) { rb_funcall(str, rb_intern("strip!"), 0); rb_ary_push(ary, str); return Qnil; } static VALUE multiline_strip(VALUE text) { VALUE map = rb_ary_new(); VALUE split = rb_str_split(text, "\n"); rb_iterate(rb_each, split, strip_i, map); return split; } static void store_kw_con(VALUE listener, const char * event_name, const char * keyword_at, size_t keyword_length, const char * at, size_t length, int current_line) { VALUE con = Qnil, kw = Qnil; kw = ENCODED_STR_NEW(keyword_at, keyword_length); con = ENCODED_STR_NEW(at, length); rb_funcall(con, rb_intern("strip!"), 0); rb_funcall(listener, rb_intern(event_name), 3, kw, con, INT2FIX(current_line)); } static void store_multiline_kw_con(VALUE listener, const char * event_name, const char * keyword_at, size_t keyword_length, const char * at, size_t length, int current_line, int eol) { VALUE con = Qnil, kw = Qnil, name = Qnil, desc = Qnil; kw = ENCODED_STR_NEW(keyword_at, keyword_length); con = ENCODED_STR_NEW(at, length); VALUE split = multiline_strip(con); name = rb_funcall(split, rb_intern("shift"), 0); desc = rb_ary_join(split, rb_str_new2( \ eol == CRLF_FLAG ? CRLF : LF )); if( name == Qnil ) { name = rb_str_new2(""); } if( rb_funcall(desc, rb_intern("size"), 0) == 0) { desc = rb_str_new2(""); } rb_funcall(name, rb_intern("strip!"), 0); rb_funcall(desc, rb_intern("strip!"), 0); rb_funcall(listener, rb_intern(event_name), 4, kw, name, desc, INT2FIX(current_line)); } static void store_attr(VALUE listener, const char * attr_type, const char * at, size_t length, int line) { VALUE val = ENCODED_STR_NEW(at, length); rb_funcall(listener, rb_intern(attr_type), 2, val, INT2FIX(line)); } static void store_pystring_content(VALUE listener, int start_col, const char *at, size_t length, int current_line) { VALUE con = ENCODED_STR_NEW(at, length); // Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters char pat[32]; snprintf(pat, 32, "^[\t ]{0,%d}", start_col); VALUE re = rb_reg_regcomp(rb_str_new2(pat)); VALUE re2 = rb_reg_regcomp(rb_str_new2("\r\\Z")); VALUE unescape_escaped_quotes = rb_reg_regcomp(rb_str_new2("\\\\\"\\\\\"\\\\\"")); rb_funcall(con, rb_intern("gsub!"), 2, re, rb_str_new2("")); rb_funcall(con, rb_intern("sub!"), 2, re2, rb_str_new2("")); rb_funcall(con, rb_intern("gsub!"), 2, unescape_escaped_quotes, rb_str_new2("\"\"\"")); rb_funcall(listener, rb_intern("py_string"), 2, con, INT2FIX(current_line)); } static void raise_lexer_error(const char * at, int line) { rb_raise(rb_eGherkinLexingError, "Lexing error on line %d: '%s'. See http://wiki.github.com/aslakhellesoy/gherkin/lexingerror for more information.", line, at); } static int count_char(char char_to_count, char *str) { int count = 0; int i = 0; while(str[i] != '\0') { if(str[i] == char_to_count) { count++; } i++; } return count; } static void lexer_init(lexer_state *lexer) { lexer->content_start = 0; lexer->content_end = 0; lexer->content_len = 0; lexer->mark = 0; lexer->keyword_start = 0; lexer->keyword_end = 0; lexer->next_keyword_start = 0; lexer->line_number = 1; lexer->last_newline = 0; lexer->final_newline = 0; lexer->start_col = 0; lexer->eol = LF_FLAG; } static VALUE CLexer_alloc(VALUE klass) { VALUE obj; lexer_state *lxr = ALLOC(lexer_state); lexer_init(lxr); obj = Data_Wrap_Struct(klass, NULL, -1, lxr); return obj; } static VALUE CLexer_init(VALUE self, VALUE listener) { rb_iv_set(self, "@listener", listener); lexer_state *lxr = NULL; DATA_GET(self, lexer_state, lxr); lexer_init(lxr); return self; } static VALUE CLexer_scan(VALUE self, VALUE input, VALUE uri, VALUE offset) { VALUE listener = rb_iv_get(self, "@listener"); rb_funcall(listener, rb_intern("location"), 2, uri, offset); lexer_state *lexer = NULL; DATA_GET(self, lexer_state, lexer); VALUE input_copy = rb_str_dup(input); rb_str_append(input_copy, rb_str_new2("\n%_FEATURE_END_%")); char *data = RSTRING_PTR(input_copy); size_t len = RSTRING_LEN(input_copy); if (count_char('\r', data) > (count_char('\n', data) / 2)) { lexer->eol = CRLF_FLAG; } if (len == 0) { rb_raise(rb_eGherkinLexingError, "No content to lex."); } else { const char *p, *pe, *eof; int cs = 0; VALUE current_row = Qnil; p = data; pe = data + len; eof = pe; assert(*pe == '\0' && "pointer does not end on NULL"); #line 1091 "ext/gherkin_lexer_pl/gherkin_lexer_pl.c" { cs = lexer_start; } #line 426 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" #line 1098 "ext/gherkin_lexer_pl/gherkin_lexer_pl.c" { int _klen; unsigned int _trans; const char *_acts; unsigned int _nacts; const char *_keys; if ( p == pe ) goto _test_eof; if ( cs == 0 ) goto _out; _resume: _keys = _lexer_trans_keys + _lexer_key_offsets[cs]; _trans = _lexer_index_offsets[cs]; _klen = _lexer_single_lengths[cs]; if ( _klen > 0 ) { const char *_lower = _keys; const char *_mid; const char *_upper = _keys + _klen - 1; while (1) { if ( _upper < _lower ) break; _mid = _lower + ((_upper-_lower) >> 1); if ( (*p) < *_mid ) _upper = _mid - 1; else if ( (*p) > *_mid ) _lower = _mid + 1; else { _trans += (_mid - _keys); goto _match; } } _keys += _klen; _trans += _klen; } _klen = _lexer_range_lengths[cs]; if ( _klen > 0 ) { const char *_lower = _keys; const char *_mid; const char *_upper = _keys + (_klen<<1) - 2; while (1) { if ( _upper < _lower ) break; _mid = _lower + (((_upper-_lower) >> 1) & ~1); if ( (*p) < _mid[0] ) _upper = _mid - 2; else if ( (*p) > _mid[1] ) _lower = _mid + 2; else { _trans += ((_mid - _keys)>>1); goto _match; } } _trans += _klen; } _match: cs = _lexer_trans_targs[_trans]; if ( _lexer_trans_actions[_trans] == 0 ) goto _again; _acts = _lexer_actions + _lexer_trans_actions[_trans]; _nacts = (unsigned int) *_acts++; while ( _nacts-- > 0 ) { switch ( *_acts++ ) { case 0: #line 86 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { MARK(content_start, p); lexer->current_line = lexer->line_number; } break; case 1: #line 91 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { MARK(content_start, p); } break; case 2: #line 95 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { lexer->current_line = lexer->line_number; lexer->start_col = p - data - lexer->last_newline; } break; case 3: #line 100 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { int len = LEN(content_start, PTR_TO(final_newline)); if (len < 0) len = 0; store_pystring_content(listener, lexer->start_col, PTR_TO(content_start), len, lexer->current_line); } break; case 4: #line 108 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { STORE_KW_END_CON(feature); } break; case 5: #line 112 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { STORE_KW_END_CON(background); } break; case 6: #line 116 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { STORE_KW_END_CON(scenario); } break; case 7: #line 120 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { STORE_KW_END_CON(scenario_outline); } break; case 8: #line 124 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { STORE_KW_END_CON(examples); } break; case 9: #line 128 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { store_kw_con(listener, "step", PTR_TO(keyword_start), LEN(keyword_start, PTR_TO(keyword_end)), PTR_TO(content_start), LEN(content_start, p), lexer->current_line); } break; case 10: #line 135 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { STORE_ATTR(comment); lexer->mark = 0; } break; case 11: #line 140 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { STORE_ATTR(tag); lexer->mark = 0; } break; case 12: #line 145 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { lexer->line_number += 1; MARK(final_newline, p); } break; case 13: #line 150 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { MARK(last_newline, p + 1); } break; case 14: #line 154 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { if (lexer->mark == 0) { MARK(mark, p); } } break; case 15: #line 160 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { MARK(keyword_end, p); MARK(keyword_start, PTR_TO(mark)); MARK(content_start, p + 1); lexer->mark = 0; } break; case 16: #line 167 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { MARK(content_end, p); } break; case 17: #line 171 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { p = p - 1; lexer->current_line = lexer->line_number; current_row = rb_ary_new(); } break; case 18: #line 177 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { MARK(content_start, p); } break; case 19: #line 181 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { VALUE con = ENCODED_STR_NEW(PTR_TO(content_start), LEN(content_start, p)); rb_funcall(con, rb_intern("strip!"), 0); VALUE re_pipe = rb_reg_regcomp(rb_str_new2("\\\\\\|")); VALUE re_backslash = rb_reg_regcomp(rb_str_new2("\\\\\\\\")); rb_funcall(con, rb_intern("gsub!"), 2, re_pipe, rb_str_new2("|")); rb_funcall(con, rb_intern("gsub!"), 2, re_backslash, rb_str_new2("\\")); rb_ary_push(current_row, con); } break; case 20: #line 192 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { rb_funcall(listener, rb_intern("row"), 2, current_row, INT2FIX(lexer->current_line)); } break; case 21: #line 196 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { if (cs < lexer_first_final) { if (raise_lexer_error != NULL) { size_t count = 0; int newstr_count = 0; size_t len; const char *buff; if (lexer->last_newline != 0) { len = LEN(last_newline, eof); buff = PTR_TO(last_newline); } else { len = strlen(data); buff = data; } char newstr[len]; for (count = 0; count < len; count++) { if(buff[count] == 10) { newstr[newstr_count] = '\0'; // terminate new string at first newline found break; } else { if (buff[count] == '%') { newstr[newstr_count++] = buff[count]; newstr[newstr_count] = buff[count]; } else { newstr[newstr_count] = buff[count]; } } newstr_count++; } int line = lexer->line_number; lexer_init(lexer); // Re-initialize so we can scan again with the same lexer raise_lexer_error(newstr, line); } } else { rb_funcall(listener, rb_intern("eof"), 0); } } break; #line 1366 "ext/gherkin_lexer_pl/gherkin_lexer_pl.c" } } _again: if ( cs == 0 ) goto _out; if ( ++p != pe ) goto _resume; _test_eof: {} if ( p == eof ) { const char *__acts = _lexer_actions + _lexer_eof_actions[cs]; unsigned int __nacts = (unsigned int) *__acts++; while ( __nacts-- > 0 ) { switch ( *__acts++ ) { case 21: #line 196 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" { if (cs < lexer_first_final) { if (raise_lexer_error != NULL) { size_t count = 0; int newstr_count = 0; size_t len; const char *buff; if (lexer->last_newline != 0) { len = LEN(last_newline, eof); buff = PTR_TO(last_newline); } else { len = strlen(data); buff = data; } char newstr[len]; for (count = 0; count < len; count++) { if(buff[count] == 10) { newstr[newstr_count] = '\0'; // terminate new string at first newline found break; } else { if (buff[count] == '%') { newstr[newstr_count++] = buff[count]; newstr[newstr_count] = buff[count]; } else { newstr[newstr_count] = buff[count]; } } newstr_count++; } int line = lexer->line_number; lexer_init(lexer); // Re-initialize so we can scan again with the same lexer raise_lexer_error(newstr, line); } } else { rb_funcall(listener, rb_intern("eof"), 0); } } break; #line 1425 "ext/gherkin_lexer_pl/gherkin_lexer_pl.c" } } } _out: {} } #line 427 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/pl.c.rl" assert(p <= pe && "data overflow after parsing execute"); assert(lexer->content_start <= len && "content starts after data end"); assert(lexer->mark < len && "mark is after data end"); // Reset lexer by re-initializing the whole thing lexer_init(lexer); if (cs == lexer_error) { rb_raise(rb_eGherkinLexingError, "Invalid format, lexing fails."); } else { return Qtrue; } } } void Init_gherkin_lexer_pl() { mGherkin = rb_define_module("Gherkin"); rb_eGherkinLexingError = rb_const_get(mGherkin, rb_intern("LexingError")); mCLexer = rb_define_module_under(mGherkin, "CLexer"); cI18nLexer = rb_define_class_under(mCLexer, "Pl", rb_cObject); rb_define_alloc_func(cI18nLexer, CLexer_alloc); rb_define_method(cI18nLexer, "initialize", CLexer_init, 1); rb_define_method(cI18nLexer, "scan", CLexer_scan, 3); }