#line 1 "/Users/ahellesoy/github/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 #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; 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 docstring_content_type_start; size_t docstring_content_type_end; size_t query_start; size_t last_newline; size_t final_newline; } lexer_state; static VALUE mGherkin; static VALUE mGherkinLexer; 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->start_col); \ 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 254 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" /** Data **/ #line 89 "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, 12, 1, 13, 1, 16, 1, 17, 1, 18, 1, 19, 1, 20, 1, 21, 1, 22, 1, 23, 2, 1, 18, 2, 4, 5, 2, 13, 0, 2, 14, 15, 2, 17, 0, 2, 17, 2, 2, 17, 16, 2, 17, 19, 2, 18, 6, 2, 18, 7, 2, 18, 8, 2, 18, 9, 2, 18, 10, 2, 18, 16, 2, 20, 21, 2, 22, 0, 2, 22, 2, 2, 22, 16, 2, 22, 19, 3, 3, 14, 15, 3, 5, 14, 15, 3, 11, 14, 15, 3, 12, 14, 15, 3, 13, 14, 15, 3, 14, 15, 18, 3, 17, 0, 11, 3, 17, 14, 15, 4, 1, 14, 15, 18, 4, 4, 5, 14, 15, 4, 17, 0, 14, 15, 5, 17, 0, 11, 14, 15 }; static const short _lexer_key_offsets[] = { 0, 0, 20, 21, 22, 41, 42, 43, 45, 47, 52, 57, 62, 67, 71, 75, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 95, 97, 102, 109, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 197, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 256, 258, 260, 262, 264, 267, 269, 271, 273, 275, 277, 279, 281, 283, 285, 287, 289, 292, 294, 296, 298, 300, 302, 304, 306, 308, 310, 312, 314, 316, 318, 320, 322, 324, 326, 328, 330, 332, 334, 336, 338, 340, 342, 344, 347, 349, 351, 353, 355, 357, 359, 361, 363, 365, 367, 369, 371, 373, 375, 377, 379, 382, 384, 386, 388, 390, 392, 394, 396, 398, 400, 402, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 440, 442, 444, 446, 448, 450, 452, 454, 456, 458, 460, 462, 464, 466, 468, 470, 472, 474, 476, 478, 481, 483, 485, 487, 489, 491, 493, 495, 497, 499, 501, 503, 505, 507, 509, 511, 513, 515, 517, 519, 521, 523, 526, 528, 530, 532, 534, 536, 538, 540, 542, 544, 546, 548, 550, 552, 554, 556, 558, 560, 562, 564, 566, 568, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 596, 598, 600, 602, 604, 606, 608, 610, 612, 614, 616, 618, 620, 622, 624, 626, 628, 630, 632, 634, 636, 638, 640, 642, 644, 647, 649, 651, 653, 655, 657, 659, 661, 663, 665, 667, 669, 671, 673, 675, 677, 679, 681, 683, 685, 687, 689, 691, 693, 695, 697, 699, 701, 703, 705, 707, 709, 711, 713, 715, 717, 719, 721, 723, 725, 727, 729, 731, 733, 735, 737, 739, 741, 742, 743, 744, 745, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 774, 776, 778, 780, 782, 784, 786, 788, 790, 792, 794, 796, 798, 800, 802, 804, 806, 808, 810, 812, 815, 817, 819, 821, 823, 825, 827, 829, 831, 833, 835, 837, 840, 842, 844, 846, 848, 850, 852, 854, 856, 858, 860, 862, 864, 866, 868, 870, 872, 874, 876, 878, 880, 882, 884, 886, 888, 890, 892, 895, 897, 899, 901, 903, 905, 907, 909, 911, 913, 915, 917, 919, 921, 923, 925, 927, 929, 931, 933, 935, 937, 938, 939, 940, 941, 945, 951, 954, 956, 962, 981 }; static const char _lexer_trans_keys[] = { -17, 10, 32, 34, 35, 37, 42, 64, 65, 73, 74, 77, 79, 80, 83, 87, 90, 124, 9, 13, -69, -65, 10, 32, 34, 35, 37, 42, 64, 65, 73, 74, 77, 79, 80, 83, 87, 90, 124, 9, 13, 34, 34, 10, 13, 10, 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, 13, 10, 13, 13, 32, 64, 9, 10, 9, 10, 13, 32, 64, 11, 12, 10, 32, 64, 9, 13, 108, 101, 101, -59, -101, -68, 108, 105, 101, 97, 106, -60, -123, 99, 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, 73, 74, 77, 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, 73, 74, 77, 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, -101, -68, 10, 10, 108, 10, 105, 10, 101, 10, 97, 10, 106, -60, 10, -123, 10, 10, 99, 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, 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, 73, 74, 77, 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, -101, -68, 10, 10, 108, 10, 105, 10, 101, 10, 97, 10, 106, -60, 10, -123, 10, 10, 99, 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, -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, 73, 74, 77, 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, -101, -68, 10, 10, 108, 10, 105, 10, 101, 10, 97, 10, 106, -60, 10, -123, 10, 10, 99, 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, -59, -126, 97, 100, 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, 73, 74, 77, 79, 80, 83, 87, 90, 124, 9, 13, 0 }; static const char _lexer_single_lengths[] = { 0, 18, 1, 1, 17, 1, 1, 2, 2, 3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 5, 3, 1, 1, 1, 1, 2, 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, 17, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 14, 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, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 14, 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, 3, 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, 14, 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, 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, 1, 1, 1, 1, 2, 4, 3, 2, 4, 17, 0 }; static const char _lexer_range_lengths[] = { 0, 1, 0, 0, 1, 0, 0, 0, 0, 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, 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, 1, 1, 0, 0, 1, 1, 0 }; static const short _lexer_index_offsets[] = { 0, 0, 20, 22, 24, 43, 45, 47, 50, 53, 58, 63, 68, 73, 77, 81, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 119, 122, 127, 134, 139, 141, 143, 145, 147, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 203, 206, 209, 212, 215, 218, 221, 224, 227, 230, 233, 236, 239, 242, 245, 264, 267, 269, 271, 273, 275, 277, 279, 281, 283, 285, 287, 289, 305, 308, 311, 314, 317, 320, 323, 326, 329, 332, 335, 338, 341, 344, 347, 350, 353, 356, 359, 362, 366, 369, 372, 375, 378, 381, 384, 387, 390, 393, 396, 399, 403, 406, 409, 412, 415, 418, 421, 424, 427, 430, 433, 436, 439, 442, 445, 448, 451, 454, 457, 460, 463, 466, 469, 472, 475, 478, 481, 485, 488, 491, 494, 497, 500, 503, 506, 509, 512, 515, 518, 521, 524, 527, 530, 533, 537, 540, 543, 546, 549, 552, 555, 558, 561, 564, 567, 570, 572, 574, 576, 578, 580, 582, 584, 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, 606, 608, 610, 626, 629, 632, 635, 638, 641, 644, 647, 650, 653, 656, 659, 662, 665, 668, 671, 674, 677, 680, 683, 687, 690, 693, 696, 699, 702, 705, 708, 711, 714, 717, 720, 723, 726, 729, 732, 735, 738, 741, 744, 747, 750, 754, 757, 760, 763, 766, 769, 772, 775, 778, 781, 784, 787, 790, 793, 796, 799, 802, 805, 808, 811, 814, 817, 820, 822, 824, 826, 828, 830, 832, 834, 836, 838, 840, 842, 844, 846, 848, 850, 861, 864, 867, 870, 873, 876, 879, 882, 885, 888, 891, 894, 897, 900, 903, 906, 909, 912, 915, 918, 921, 924, 927, 930, 933, 937, 940, 943, 946, 949, 952, 955, 958, 961, 964, 967, 970, 973, 976, 979, 982, 985, 988, 991, 994, 997, 1000, 1003, 1006, 1009, 1012, 1015, 1018, 1021, 1024, 1027, 1030, 1033, 1036, 1039, 1042, 1045, 1048, 1051, 1054, 1057, 1060, 1063, 1066, 1069, 1072, 1075, 1078, 1080, 1082, 1084, 1086, 1089, 1091, 1093, 1095, 1097, 1099, 1101, 1103, 1105, 1107, 1109, 1111, 1127, 1130, 1133, 1136, 1139, 1142, 1145, 1148, 1151, 1154, 1157, 1160, 1163, 1166, 1169, 1172, 1175, 1178, 1181, 1184, 1188, 1191, 1194, 1197, 1200, 1203, 1206, 1209, 1212, 1215, 1218, 1221, 1225, 1228, 1231, 1234, 1237, 1240, 1243, 1246, 1249, 1252, 1255, 1258, 1261, 1264, 1267, 1270, 1273, 1276, 1279, 1282, 1285, 1288, 1291, 1294, 1297, 1300, 1303, 1307, 1310, 1313, 1316, 1319, 1322, 1325, 1328, 1331, 1334, 1337, 1340, 1343, 1346, 1349, 1352, 1355, 1358, 1361, 1364, 1367, 1370, 1372, 1374, 1376, 1378, 1382, 1388, 1392, 1395, 1401, 1420 }; static const short _lexer_trans_targs[] = { 2, 4, 4, 5, 15, 17, 31, 34, 37, 31, 39, 45, 50, 53, 81, 265, 357, 455, 4, 0, 3, 0, 4, 0, 4, 4, 5, 15, 17, 31, 34, 37, 31, 39, 45, 50, 53, 81, 265, 357, 455, 4, 0, 6, 0, 7, 0, 9, 8, 8, 9, 8, 8, 10, 10, 11, 10, 10, 10, 10, 11, 10, 10, 10, 10, 12, 10, 10, 10, 10, 13, 10, 10, 4, 14, 14, 0, 4, 14, 14, 0, 4, 16, 15, 4, 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, 30, 0, 461, 0, 32, 0, 4, 16, 33, 4, 16, 33, 0, 0, 0, 0, 35, 36, 4, 36, 36, 34, 35, 35, 4, 36, 34, 36, 0, 38, 0, 31, 0, 40, 0, 41, 0, 42, 44, 0, 43, 0, 31, 0, 42, 0, 46, 0, 47, 0, 48, 0, 49, 0, 31, 0, 51, 0, 52, 0, 31, 0, 54, 0, 55, 0, 56, 0, 57, 0, 58, 0, 59, 0, 60, 0, 61, 0, 62, 0, 63, 0, 65, 64, 65, 64, 65, 65, 4, 66, 4, 65, 64, 67, 65, 64, 68, 65, 64, 65, 69, 64, 70, 65, 64, 71, 65, 64, 65, 72, 64, 65, 73, 64, 65, 74, 64, 65, 75, 64, 76, 65, 64, 77, 65, 64, 78, 65, 64, 79, 65, 64, 65, 80, 64, 4, 4, 5, 15, 17, 31, 34, 37, 31, 39, 45, 50, 53, 81, 265, 357, 455, 4, 0, 82, 181, 0, 83, 0, 84, 0, 85, 0, 86, 0, 87, 0, 88, 0, 89, 0, 90, 0, 91, 0, 93, 92, 93, 92, 93, 93, 4, 94, 108, 4, 109, 108, 111, 117, 122, 125, 152, 168, 93, 92, 93, 95, 92, 93, 96, 92, 93, 97, 92, 93, 98, 92, 93, 99, 92, 93, 100, 92, 93, 101, 92, 93, 102, 92, 93, 103, 92, 93, 104, 92, 93, 105, 92, 93, 106, 92, 93, 107, 92, 93, 4, 92, 93, 80, 92, 93, 110, 92, 93, 108, 92, 93, 112, 92, 113, 93, 92, 114, 116, 93, 92, 93, 115, 92, 93, 108, 92, 93, 114, 92, 93, 118, 92, 93, 119, 92, 120, 93, 92, 121, 93, 92, 93, 108, 92, 93, 123, 92, 93, 124, 92, 93, 108, 92, 93, 126, 135, 92, 93, 127, 92, 93, 128, 92, 93, 129, 92, 93, 130, 92, 93, 131, 92, 93, 132, 92, 93, 133, 92, 93, 134, 92, 93, 80, 92, 93, 136, 92, 93, 137, 92, 93, 138, 92, 93, 139, 92, 93, 140, 92, 93, 141, 92, 93, 142, 92, 93, 143, 92, 93, 144, 92, 93, 145, 92, 93, 146, 92, 93, 147, 92, 93, 148, 92, 93, 149, 92, 93, 150, 92, 93, 151, 92, 93, 134, 92, 153, 93, 165, 92, 154, 93, 92, 93, 155, 92, 156, 93, 92, 157, 93, 92, 93, 158, 92, 93, 159, 92, 93, 160, 92, 93, 161, 92, 162, 93, 92, 163, 93, 92, 164, 93, 92, 134, 93, 92, 93, 166, 92, 93, 167, 92, 93, 108, 92, 93, 169, 92, 170, 93, 177, 92, 171, 93, 92, 93, 172, 92, 173, 93, 92, 174, 93, 92, 93, 175, 92, 93, 176, 92, 93, 151, 92, 178, 93, 92, 179, 93, 92, 93, 180, 92, 93, 117, 92, 182, 0, 183, 0, 184, 0, 185, 0, 186, 0, 187, 0, 188, 0, 189, 0, 190, 0, 191, 0, 192, 0, 193, 0, 194, 0, 195, 0, 196, 0, 197, 0, 198, 0, 199, 0, 201, 200, 201, 200, 201, 201, 4, 202, 216, 4, 217, 216, 219, 225, 230, 233, 243, 259, 201, 200, 201, 203, 200, 201, 204, 200, 201, 205, 200, 201, 206, 200, 201, 207, 200, 201, 208, 200, 201, 209, 200, 201, 210, 200, 201, 211, 200, 201, 212, 200, 201, 213, 200, 201, 214, 200, 201, 215, 200, 201, 4, 200, 201, 80, 200, 201, 218, 200, 201, 216, 200, 201, 220, 200, 221, 201, 200, 222, 224, 201, 200, 201, 223, 200, 201, 216, 200, 201, 222, 200, 201, 226, 200, 201, 227, 200, 228, 201, 200, 229, 201, 200, 201, 216, 200, 201, 231, 200, 201, 232, 200, 201, 216, 200, 201, 234, 200, 201, 235, 200, 201, 236, 200, 201, 237, 200, 201, 238, 200, 201, 239, 200, 201, 240, 200, 201, 241, 200, 201, 242, 200, 201, 80, 200, 244, 201, 256, 200, 245, 201, 200, 201, 246, 200, 247, 201, 200, 248, 201, 200, 201, 249, 200, 201, 250, 200, 201, 251, 200, 201, 252, 200, 253, 201, 200, 254, 201, 200, 255, 201, 200, 242, 201, 200, 201, 257, 200, 201, 258, 200, 201, 216, 200, 201, 260, 200, 201, 261, 200, 262, 201, 200, 263, 201, 200, 201, 264, 200, 201, 225, 200, 266, 354, 0, 267, 0, 268, 0, 269, 0, 270, 0, 271, 0, 272, 0, 273, 0, 274, 0, 275, 0, 276, 0, 277, 0, 278, 0, 279, 0, 281, 280, 281, 280, 281, 281, 4, 282, 4, 296, 306, 332, 345, 281, 280, 281, 283, 280, 281, 284, 280, 281, 285, 280, 281, 286, 280, 281, 287, 280, 281, 288, 280, 281, 289, 280, 281, 290, 280, 281, 291, 280, 281, 292, 280, 281, 293, 280, 281, 294, 280, 281, 295, 280, 281, 4, 280, 281, 297, 280, 281, 298, 280, 281, 299, 280, 281, 300, 280, 301, 281, 280, 302, 281, 280, 281, 303, 280, 281, 304, 280, 281, 305, 280, 281, 80, 280, 281, 307, 315, 280, 281, 308, 280, 281, 309, 280, 281, 310, 280, 281, 311, 280, 281, 312, 280, 281, 313, 280, 281, 314, 280, 281, 305, 280, 281, 316, 280, 281, 317, 280, 281, 318, 280, 281, 319, 280, 281, 320, 280, 281, 321, 280, 281, 322, 280, 281, 323, 280, 281, 324, 280, 281, 325, 280, 281, 326, 280, 281, 327, 280, 281, 328, 280, 281, 329, 280, 281, 330, 280, 281, 331, 280, 281, 305, 280, 333, 281, 280, 334, 281, 280, 281, 335, 280, 336, 281, 280, 337, 281, 280, 281, 338, 280, 281, 339, 280, 281, 340, 280, 281, 341, 280, 342, 281, 280, 343, 281, 280, 344, 281, 280, 305, 281, 280, 281, 346, 280, 347, 281, 280, 348, 281, 280, 281, 349, 280, 350, 281, 280, 351, 281, 280, 281, 352, 280, 281, 353, 280, 281, 331, 280, 355, 0, 356, 0, 31, 0, 358, 0, 359, 451, 0, 360, 0, 361, 0, 362, 0, 363, 0, 364, 0, 365, 0, 366, 0, 367, 0, 368, 0, 370, 369, 370, 369, 370, 370, 4, 371, 385, 4, 386, 385, 388, 394, 399, 402, 429, 445, 370, 369, 370, 372, 369, 370, 373, 369, 370, 374, 369, 370, 375, 369, 370, 376, 369, 370, 377, 369, 370, 378, 369, 370, 379, 369, 370, 380, 369, 370, 381, 369, 370, 382, 369, 370, 383, 369, 370, 384, 369, 370, 4, 369, 370, 80, 369, 370, 387, 369, 370, 385, 369, 370, 389, 369, 390, 370, 369, 391, 393, 370, 369, 370, 392, 369, 370, 385, 369, 370, 391, 369, 370, 395, 369, 370, 396, 369, 397, 370, 369, 398, 370, 369, 370, 385, 369, 370, 400, 369, 370, 401, 369, 370, 385, 369, 370, 403, 412, 369, 370, 404, 369, 370, 405, 369, 370, 406, 369, 370, 407, 369, 370, 408, 369, 370, 409, 369, 370, 410, 369, 370, 411, 369, 370, 80, 369, 370, 413, 369, 370, 414, 369, 370, 415, 369, 370, 416, 369, 370, 417, 369, 370, 418, 369, 370, 419, 369, 370, 420, 369, 370, 421, 369, 370, 422, 369, 370, 423, 369, 370, 424, 369, 370, 425, 369, 370, 426, 369, 370, 427, 369, 370, 428, 369, 370, 411, 369, 430, 370, 442, 369, 431, 370, 369, 370, 432, 369, 433, 370, 369, 434, 370, 369, 370, 435, 369, 370, 436, 369, 370, 437, 369, 370, 438, 369, 439, 370, 369, 440, 370, 369, 441, 370, 369, 411, 370, 369, 370, 443, 369, 370, 444, 369, 370, 385, 369, 370, 446, 369, 370, 447, 369, 448, 370, 369, 449, 370, 369, 370, 450, 369, 370, 394, 369, 452, 0, 453, 0, 454, 0, 45, 0, 455, 456, 455, 0, 460, 459, 458, 456, 459, 457, 0, 458, 456, 457, 0, 458, 457, 460, 459, 458, 456, 459, 457, 460, 460, 5, 15, 17, 31, 34, 37, 31, 39, 45, 50, 53, 81, 265, 357, 455, 460, 0, 0, 0 }; static const unsigned char _lexer_trans_actions[] = { 0, 54, 0, 5, 1, 0, 29, 1, 29, 29, 29, 29, 29, 29, 29, 29, 29, 35, 0, 43, 0, 43, 0, 43, 54, 0, 5, 1, 0, 29, 1, 29, 29, 29, 29, 29, 29, 29, 29, 29, 35, 0, 43, 0, 43, 0, 43, 139, 48, 9, 106, 11, 0, 134, 45, 45, 45, 3, 122, 33, 33, 33, 0, 122, 33, 33, 33, 0, 122, 33, 0, 33, 0, 102, 7, 7, 43, 54, 0, 0, 43, 114, 25, 0, 54, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 149, 126, 57, 110, 23, 0, 43, 43, 43, 43, 0, 27, 118, 27, 27, 51, 27, 0, 54, 0, 1, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 144, 57, 54, 0, 54, 0, 81, 84, 81, 0, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 54, 21, 0, 130, 31, 60, 57, 31, 63, 57, 63, 63, 63, 63, 63, 63, 63, 63, 63, 66, 31, 43, 0, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 144, 57, 54, 0, 54, 0, 75, 33, 84, 75, 84, 84, 84, 84, 84, 84, 84, 84, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 17, 0, 54, 17, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 17, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 0, 54, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 0, 54, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 144, 57, 54, 0, 54, 0, 78, 33, 84, 78, 84, 84, 84, 84, 84, 84, 84, 84, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 19, 0, 54, 19, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 19, 0, 0, 54, 0, 0, 0, 54, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 0, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 144, 57, 54, 0, 54, 0, 69, 33, 69, 84, 84, 84, 84, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 13, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 13, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 43, 0, 43, 0, 43, 0, 43, 0, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 0, 43, 144, 57, 54, 0, 54, 0, 72, 33, 84, 72, 84, 84, 84, 84, 84, 84, 84, 84, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 15, 0, 54, 15, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 15, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 0, 54, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 54, 0, 0, 0, 54, 0, 0, 54, 0, 54, 0, 0, 54, 0, 0, 0, 43, 0, 43, 0, 43, 0, 43, 0, 0, 0, 43, 54, 37, 37, 87, 37, 37, 43, 0, 39, 0, 43, 0, 0, 54, 0, 0, 39, 0, 0, 54, 0, 93, 90, 41, 96, 90, 96, 96, 96, 96, 96, 96, 96, 96, 96, 99, 0, 43, 0, 0 }; static const unsigned char _lexer_eof_actions[] = { 0, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43 }; static const int lexer_start = 1; static const int lexer_first_final = 461; static const int lexer_error = 0; static const int lexer_en_main = 1; #line 258 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" static VALUE unindent(VALUE con, int start_col) { VALUE re; // 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); re = rb_reg_regcomp(rb_str_new2(pat)); rb_funcall(con, rb_intern("gsub!"), 2, re, rb_str_new2("")); return Qnil; } 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 start_col) { VALUE split; VALUE con = Qnil, kw = Qnil, name = Qnil, desc = Qnil; kw = ENCODED_STR_NEW(keyword_at, keyword_length); con = ENCODED_STR_NEW(at, length); unindent(con, start_col); split = rb_str_split(con, "\n"); name = rb_funcall(split, rb_intern("shift"), 0); desc = rb_ary_join(split, rb_str_new2( "\n" )); 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("rstrip!"), 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_docstring_content(VALUE listener, int start_col, const char *type_at, size_t type_length, const char *at, size_t length, int current_line) { VALUE re2; VALUE unescape_escaped_quotes; VALUE con = ENCODED_STR_NEW(at, length); VALUE con_type = ENCODED_STR_NEW(type_at, type_length); unindent(con, start_col); re2 = rb_reg_regcomp(rb_str_new2("\r\\Z")); unescape_escaped_quotes = rb_reg_regcomp(rb_str_new2("\\\\\"\\\\\"\\\\\"")); rb_funcall(con, rb_intern("sub!"), 2, re2, rb_str_new2("")); rb_funcall(con_type, rb_intern("strip!"), 0); rb_funcall(con, rb_intern("gsub!"), 2, unescape_escaped_quotes, rb_str_new2("\"\"\"")); rb_funcall(listener, rb_intern("doc_string"), 3, con_type, 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/cucumber/gherkin/lexingerror for more information.", line, at); } static void lexer_init(lexer_state *lexer) { lexer->content_start = 0; lexer->content_end = 0; lexer->content_len = 0; lexer->docstring_content_type_start = 0; lexer->docstring_content_type_end = 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; } 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) { lexer_state *lxr; rb_iv_set(self, "@listener", listener); lxr = NULL; DATA_GET(self, lexer_state, lxr); lexer_init(lxr); return self; } static VALUE CLexer_scan(VALUE self, VALUE input) { VALUE input_copy; char *data; size_t len; VALUE listener = rb_iv_get(self, "@listener"); lexer_state *lexer; lexer = NULL; DATA_GET(self, lexer_state, lexer); input_copy = rb_str_dup(input); rb_str_append(input_copy, rb_str_new2("\n%_FEATURE_END_%")); data = RSTRING_PTR(input_copy); len = RSTRING_LEN(input_copy); 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 1081 "ext/gherkin_lexer_pl/gherkin_lexer_pl.c" { cs = lexer_start; } #line 425 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" #line 1088 "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 83 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { MARK(content_start, p); lexer->current_line = lexer->line_number; lexer->start_col = lexer->content_start - lexer->last_newline - (lexer->keyword_end - lexer->keyword_start) + 2; } break; case 1: #line 89 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { MARK(content_start, p); } break; case 2: #line 93 "/Users/ahellesoy/github/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 98 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { int len = LEN(content_start, PTR_TO(final_newline)); int type_len = LEN(docstring_content_type_start, PTR_TO(docstring_content_type_end)); if (len < 0) len = 0; if (type_len < 0) len = 0; store_docstring_content(listener, lexer->start_col, PTR_TO(docstring_content_type_start), type_len, PTR_TO(content_start), len, lexer->current_line); } break; case 4: #line 108 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { MARK(docstring_content_type_start, p); } break; case 5: #line 112 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { MARK(docstring_content_type_end, p); } break; case 6: #line 116 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { STORE_KW_END_CON(feature); } break; case 7: #line 120 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { STORE_KW_END_CON(background); } break; case 8: #line 124 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { STORE_KW_END_CON(scenario); } break; case 9: #line 128 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { STORE_KW_END_CON(scenario_outline); } break; case 10: #line 132 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { STORE_KW_END_CON(examples); } break; case 11: #line 136 "/Users/ahellesoy/github/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 12: #line 143 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { STORE_ATTR(comment); lexer->mark = 0; } break; case 13: #line 148 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { STORE_ATTR(tag); lexer->mark = 0; } break; case 14: #line 153 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { lexer->line_number += 1; MARK(final_newline, p); } break; case 15: #line 158 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { MARK(last_newline, p + 1); } break; case 16: #line 162 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { if (lexer->mark == 0) { MARK(mark, p); } } break; case 17: #line 168 "/Users/ahellesoy/github/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 18: #line 175 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { MARK(content_end, p); } break; case 19: #line 179 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { p = p - 1; lexer->current_line = lexer->line_number; current_row = rb_ary_new(); } break; case 20: #line 185 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { MARK(content_start, p); } break; case 21: #line 189 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { VALUE re_pipe, re_newline, re_backslash; VALUE con = ENCODED_STR_NEW(PTR_TO(content_start), LEN(content_start, p)); rb_funcall(con, rb_intern("strip!"), 0); re_pipe = rb_reg_regcomp(rb_str_new2("\\\\\\|")); re_newline = rb_reg_regcomp(rb_str_new2("\\\\n")); 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_newline, rb_str_new2("\n")); rb_funcall(con, rb_intern("gsub!"), 2, re_backslash, rb_str_new2("\\")); rb_ary_push(current_row, con); } break; case 22: #line 203 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { rb_funcall(listener, rb_intern("row"), 2, current_row, INT2FIX(lexer->current_line)); } break; case 23: #line 207 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { int line; if (cs < lexer_first_final) { size_t count = 0; VALUE newstr_val; char *newstr; 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; } // Allocate as a ruby string so that it gets cleaned up by GC newstr_val = rb_str_new(buff, len); newstr = RSTRING_PTR(newstr_val); 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++; } 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 1378 "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 23: #line 207 "/Users/ahellesoy/github/gherkin/tasks/../ragel/i18n/pl.c.rl" { int line; if (cs < lexer_first_final) { size_t count = 0; VALUE newstr_val; char *newstr; 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; } // Allocate as a ruby string so that it gets cleaned up by GC newstr_val = rb_str_new(buff, len); newstr = RSTRING_PTR(newstr_val); 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++; } 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 1441 "ext/gherkin_lexer_pl/gherkin_lexer_pl.c" } } } _out: {} } #line 426 "/Users/ahellesoy/github/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"); mGherkinLexer = rb_define_module_under(mGherkin, "Lexer"); rb_eGherkinLexingError = rb_const_get(mGherkinLexer, 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, 1); }