UNPKG

gherkin

Version:

A fast Gherkin lexer/parser based on the Ragel State Machine Compiler.

908 lines (843 loc) 28.3 kB
/* line 1 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ ;(function() { /* line 117 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ /* line 11 "js/lib/gherkin/lexer/id.js" */ const _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, 2, 16, 2, 11, 0, 2, 12, 13, 2, 15, 0, 2, 15, 1, 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, 1, 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, 2, 12, 13, 16, 4, 15, 0, 12, 13 ]; const _lexer_key_offsets = [ 0, 0, 18, 35, 36, 37, 41, 46, 51, 56, 61, 65, 69, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 90, 95, 102, 107, 108, 109, 110, 111, 112, 113, 114, 115, 122, 124, 126, 128, 130, 132, 149, 151, 153, 154, 155, 156, 157, 158, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 205, 207, 209, 211, 213, 215, 217, 219, 221, 223, 225, 227, 229, 231, 233, 235, 237, 239, 241, 243, 245, 247, 249, 252, 254, 256, 258, 260, 262, 264, 266, 268, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 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, 346, 348, 350, 352, 354, 356, 358, 360, 363, 365, 367, 369, 371, 373, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 413, 415, 417, 419, 421, 423, 425, 427, 429, 431, 433, 435, 437, 439, 441, 443, 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, 496, 497, 498, 512, 514, 516, 518, 520, 522, 524, 526, 528, 530, 532, 534, 536, 538, 540, 542, 545, 548, 550, 552, 554, 556, 558, 560, 562, 564, 566, 568, 570, 572, 574, 576, 578, 580, 582, 584, 586, 588, 590, 592, 594, 597, 599, 601, 603, 605, 607, 609, 611, 613, 615, 616, 617, 618, 622, 628, 631, 633, 639, 656, 657, 658 ]; const _lexer_trans_keys = [ 10, 32, 34, 35, 37, 42, 64, 67, 68, 70, 75, 77, 83, 84, 124, 239, 9, 13, 10, 32, 34, 35, 37, 42, 64, 67, 68, 70, 75, 77, 83, 84, 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, 111, 110, 116, 111, 104, 58, 10, 10, 10, 32, 35, 70, 124, 9, 13, 10, 105, 10, 116, 10, 117, 10, 114, 10, 58, 10, 32, 34, 35, 37, 42, 64, 67, 68, 70, 75, 77, 83, 84, 124, 9, 13, 97, 101, 110, 115, 97, 114, 58, 10, 10, 10, 32, 35, 37, 42, 64, 68, 70, 75, 77, 83, 84, 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, 97, 101, 10, 110, 10, 110, 10, 103, 10, 97, 10, 105, 10, 116, 10, 117, 10, 114, 10, 58, 10, 101, 10, 116, 10, 105, 10, 107, 10, 97, 10, 97, 10, 107, 10, 101, 10, 110, 10, 97, 10, 114, 10, 105, 10, 111, 10, 32, 58, 10, 107, 10, 111, 10, 110, 10, 115, 10, 101, 10, 112, 10, 97, 10, 112, 10, 105, 110, 103, 97, 110, 105, 116, 117, 114, 58, 10, 10, 10, 32, 35, 37, 64, 67, 68, 70, 83, 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, 111, 10, 110, 10, 116, 10, 111, 10, 104, 10, 58, 10, 97, 10, 115, 10, 97, 10, 114, 10, 105, 10, 116, 10, 117, 10, 107, 10, 101, 10, 110, 10, 97, 10, 114, 10, 105, 10, 111, 10, 32, 58, 10, 107, 10, 111, 10, 110, 10, 115, 10, 101, 10, 112, 101, 116, 105, 107, 97, 97, 107, 101, 110, 97, 114, 105, 111, 32, 58, 107, 111, 110, 115, 101, 112, 58, 10, 10, 10, 32, 35, 37, 42, 64, 68, 70, 75, 77, 83, 84, 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, 97, 101, 10, 110, 10, 110, 10, 103, 10, 97, 10, 105, 10, 116, 10, 117, 10, 114, 10, 58, 10, 101, 10, 116, 10, 105, 10, 107, 10, 97, 10, 97, 10, 107, 10, 101, 10, 110, 10, 97, 10, 114, 10, 105, 10, 111, 10, 97, 10, 112, 10, 105, 10, 10, 10, 32, 35, 37, 42, 64, 68, 70, 75, 77, 83, 84, 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, 97, 101, 10, 110, 115, 10, 97, 10, 114, 10, 58, 10, 110, 10, 103, 10, 97, 10, 110, 10, 105, 10, 116, 10, 117, 10, 101, 10, 116, 10, 105, 10, 107, 10, 97, 10, 97, 10, 107, 10, 101, 10, 110, 10, 97, 10, 114, 10, 105, 10, 111, 10, 32, 58, 10, 107, 10, 111, 10, 110, 10, 115, 10, 101, 10, 112, 10, 97, 10, 112, 10, 105, 97, 112, 105, 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, 67, 68, 70, 75, 77, 83, 84, 124, 9, 13, 187, 191, 0 ]; const _lexer_single_lengths = [ 0, 16, 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, 5, 2, 2, 2, 2, 2, 15, 2, 2, 1, 1, 1, 1, 1, 12, 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, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 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, 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, 1, 1, 12, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 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, 1, 1, 1, 2, 4, 3, 2, 4, 15, 1, 1, 0 ]; const _lexer_range_lengths = [ 0, 1, 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, 1, 0, 0, 0, 0, 0, 1, 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, 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, 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, 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, 1, 1, 0, 0, 1, 1, 0, 0, 0 ]; const _lexer_index_offsets = [ 0, 0, 18, 35, 37, 39, 43, 48, 53, 58, 63, 67, 71, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 111, 116, 123, 128, 130, 132, 134, 136, 138, 140, 142, 144, 151, 154, 157, 160, 163, 166, 183, 186, 189, 191, 193, 195, 197, 199, 213, 216, 219, 222, 225, 228, 231, 234, 237, 240, 243, 246, 249, 252, 255, 258, 262, 265, 268, 271, 274, 277, 280, 283, 286, 289, 292, 295, 298, 301, 304, 307, 310, 313, 316, 319, 322, 325, 328, 332, 335, 338, 341, 344, 347, 350, 353, 356, 359, 361, 363, 365, 367, 369, 371, 373, 375, 377, 379, 381, 392, 395, 398, 401, 404, 407, 410, 413, 416, 419, 422, 425, 428, 431, 434, 437, 440, 443, 446, 449, 452, 455, 458, 461, 464, 467, 470, 473, 476, 479, 482, 485, 488, 491, 494, 498, 501, 504, 507, 510, 513, 516, 518, 520, 522, 524, 526, 528, 530, 532, 534, 536, 538, 540, 542, 545, 547, 549, 551, 553, 555, 557, 559, 561, 563, 577, 580, 583, 586, 589, 592, 595, 598, 601, 604, 607, 610, 613, 616, 619, 622, 626, 629, 632, 635, 638, 641, 644, 647, 650, 653, 656, 659, 662, 665, 668, 671, 674, 677, 680, 683, 686, 689, 692, 695, 698, 701, 703, 705, 719, 722, 725, 728, 731, 734, 737, 740, 743, 746, 749, 752, 755, 758, 761, 764, 768, 772, 775, 778, 781, 784, 787, 790, 793, 796, 799, 802, 805, 808, 811, 814, 817, 820, 823, 826, 829, 832, 835, 838, 841, 845, 848, 851, 854, 857, 860, 863, 866, 869, 872, 874, 876, 878, 882, 888, 892, 895, 901, 918, 920, 922 ]; const _lexer_indicies = [ 2, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 0, 2, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 0, 17, 0, 18, 0, 19, 18, 18, 0, 22, 21, 23, 21, 20, 26, 25, 27, 25, 24, 26, 25, 28, 25, 24, 26, 25, 29, 25, 24, 31, 30, 30, 0, 2, 32, 32, 0, 34, 35, 33, 2, 0, 36, 0, 37, 0, 38, 0, 39, 0, 40, 0, 41, 0, 42, 0, 43, 0, 44, 0, 45, 0, 46, 0, 47, 0, 48, 0, 49, 0, 50, 0, 0, 51, 53, 54, 52, 0, 0, 0, 0, 55, 56, 57, 56, 56, 59, 58, 55, 2, 60, 7, 60, 0, 61, 0, 62, 0, 63, 0, 64, 0, 65, 0, 66, 0, 68, 67, 70, 69, 70, 71, 72, 73, 72, 71, 69, 70, 74, 69, 70, 75, 69, 70, 76, 69, 70, 77, 69, 70, 78, 69, 80, 79, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 79, 0, 94, 95, 0, 96, 97, 0, 98, 0, 99, 0, 100, 0, 102, 101, 104, 103, 104, 105, 106, 107, 108, 106, 109, 110, 111, 112, 113, 114, 105, 103, 104, 115, 103, 104, 116, 103, 104, 117, 103, 104, 118, 103, 104, 119, 103, 104, 120, 103, 104, 121, 103, 104, 122, 103, 104, 123, 103, 104, 124, 103, 104, 125, 103, 104, 126, 103, 104, 127, 103, 104, 128, 103, 104, 129, 103, 104, 130, 131, 103, 104, 132, 103, 104, 133, 103, 104, 134, 103, 104, 130, 103, 104, 135, 103, 104, 136, 103, 104, 137, 103, 104, 138, 103, 104, 129, 103, 104, 139, 103, 104, 140, 103, 104, 141, 103, 104, 142, 103, 104, 132, 103, 104, 141, 103, 104, 143, 103, 104, 144, 103, 104, 145, 103, 104, 146, 103, 104, 147, 103, 104, 148, 103, 104, 149, 103, 104, 150, 129, 103, 104, 151, 103, 104, 152, 103, 104, 153, 103, 104, 154, 103, 104, 155, 103, 104, 138, 103, 104, 156, 103, 104, 157, 103, 104, 132, 103, 158, 0, 159, 0, 160, 0, 96, 0, 161, 0, 162, 0, 163, 0, 164, 0, 165, 0, 167, 166, 169, 168, 169, 170, 171, 172, 171, 173, 174, 175, 176, 170, 168, 169, 177, 168, 169, 178, 168, 169, 179, 168, 169, 180, 168, 169, 181, 168, 169, 182, 168, 169, 183, 168, 169, 184, 168, 169, 185, 168, 169, 186, 168, 169, 187, 168, 169, 188, 168, 169, 189, 168, 169, 190, 168, 169, 191, 168, 169, 192, 168, 169, 193, 168, 169, 194, 168, 169, 195, 168, 169, 196, 168, 169, 197, 168, 169, 198, 168, 169, 199, 168, 169, 195, 168, 169, 200, 168, 169, 201, 168, 169, 199, 168, 169, 202, 168, 169, 203, 168, 169, 204, 168, 169, 205, 168, 169, 206, 168, 169, 207, 168, 169, 208, 168, 169, 209, 196, 168, 169, 210, 168, 169, 211, 168, 169, 212, 168, 169, 213, 168, 169, 214, 168, 169, 195, 168, 215, 0, 216, 0, 217, 0, 218, 0, 96, 0, 217, 0, 219, 0, 220, 0, 221, 0, 222, 0, 223, 0, 224, 0, 225, 0, 226, 227, 0, 228, 0, 229, 0, 230, 0, 231, 0, 232, 0, 233, 0, 234, 0, 236, 235, 238, 237, 238, 239, 240, 241, 242, 240, 243, 244, 245, 246, 247, 248, 239, 237, 238, 249, 237, 238, 250, 237, 238, 251, 237, 238, 252, 237, 238, 253, 237, 238, 254, 237, 238, 255, 237, 238, 256, 237, 238, 257, 237, 238, 258, 237, 238, 259, 237, 238, 260, 237, 238, 261, 237, 238, 262, 237, 238, 263, 237, 238, 264, 265, 237, 238, 266, 237, 238, 267, 237, 238, 268, 237, 238, 264, 237, 238, 269, 237, 238, 270, 237, 238, 271, 237, 238, 272, 237, 238, 263, 237, 238, 273, 237, 238, 274, 237, 238, 275, 237, 238, 276, 237, 238, 266, 237, 238, 275, 237, 238, 277, 237, 238, 278, 237, 238, 279, 237, 238, 280, 237, 238, 281, 237, 238, 282, 237, 238, 272, 237, 238, 283, 237, 238, 284, 237, 238, 266, 237, 286, 285, 288, 287, 288, 289, 290, 291, 292, 290, 293, 294, 295, 296, 297, 298, 289, 287, 288, 299, 287, 288, 300, 287, 288, 301, 287, 288, 302, 287, 288, 303, 287, 288, 304, 287, 288, 305, 287, 288, 306, 287, 288, 307, 287, 288, 308, 287, 288, 309, 287, 288, 310, 287, 288, 311, 287, 288, 312, 287, 288, 313, 287, 288, 314, 315, 287, 288, 316, 317, 287, 288, 318, 287, 288, 319, 287, 288, 313, 287, 288, 320, 287, 288, 321, 287, 288, 322, 287, 288, 316, 287, 288, 323, 287, 288, 324, 287, 288, 318, 287, 288, 325, 287, 288, 326, 287, 288, 327, 287, 288, 328, 287, 288, 316, 287, 288, 327, 287, 288, 329, 287, 288, 330, 287, 288, 331, 287, 288, 332, 287, 288, 333, 287, 288, 334, 287, 288, 335, 287, 288, 336, 313, 287, 288, 337, 287, 288, 338, 287, 288, 339, 287, 288, 340, 287, 288, 341, 287, 288, 319, 287, 288, 342, 287, 288, 343, 287, 288, 316, 287, 344, 0, 345, 0, 96, 0, 346, 347, 346, 0, 350, 349, 351, 352, 349, 348, 0, 354, 355, 353, 0, 354, 353, 350, 356, 354, 355, 356, 353, 350, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 357, 0, 371, 0, 1, 0, 372, 0 ]; const _lexer_trans_targs = [ 0, 2, 2, 3, 12, 14, 28, 31, 34, 49, 109, 158, 163, 164, 276, 279, 285, 4, 5, 6, 7, 7, 7, 8, 7, 7, 7, 8, 9, 10, 11, 2, 11, 12, 2, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 287, 29, 30, 30, 2, 13, 32, 33, 2, 32, 31, 33, 35, 36, 37, 38, 39, 40, 41, 42, 41, 42, 42, 2, 43, 44, 45, 46, 47, 48, 2, 2, 3, 12, 14, 28, 31, 34, 49, 109, 158, 163, 164, 276, 279, 50, 105, 28, 51, 52, 53, 54, 55, 56, 55, 56, 56, 2, 57, 71, 72, 77, 82, 87, 88, 102, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 2, 48, 73, 74, 71, 75, 76, 78, 79, 80, 81, 83, 84, 85, 86, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 103, 104, 106, 107, 108, 110, 111, 112, 113, 114, 115, 116, 115, 116, 116, 2, 117, 131, 137, 141, 144, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 2, 132, 133, 134, 135, 136, 48, 138, 139, 140, 142, 143, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 159, 160, 161, 162, 165, 166, 167, 168, 169, 170, 171, 172, 223, 173, 174, 175, 176, 177, 178, 179, 180, 181, 180, 181, 181, 2, 182, 196, 197, 202, 207, 212, 213, 220, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 2, 48, 198, 199, 196, 200, 201, 203, 204, 205, 206, 208, 209, 210, 211, 214, 215, 216, 217, 218, 219, 221, 222, 224, 225, 224, 225, 225, 2, 226, 240, 241, 250, 253, 258, 259, 273, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 2, 48, 242, 246, 240, 243, 244, 245, 247, 248, 249, 251, 252, 254, 255, 256, 257, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 274, 275, 277, 278, 279, 280, 281, 283, 284, 282, 280, 281, 282, 280, 283, 284, 3, 12, 14, 28, 31, 34, 49, 109, 158, 163, 164, 276, 279, 286, 0 ]; const _lexer_trans_actions = [ 39, 0, 47, 3, 1, 0, 25, 1, 25, 25, 25, 25, 25, 25, 25, 31, 0, 0, 0, 47, 5, 41, 119, 41, 0, 29, 111, 29, 29, 0, 7, 95, 0, 0, 103, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 99, 19, 0, 23, 107, 23, 44, 0, 0, 0, 0, 0, 0, 0, 50, 124, 0, 47, 0, 74, 77, 0, 0, 0, 0, 17, 27, 115, 53, 50, 27, 56, 50, 56, 56, 56, 56, 56, 56, 56, 59, 0, 0, 0, 0, 0, 0, 0, 50, 124, 0, 47, 0, 65, 29, 77, 77, 77, 77, 77, 77, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 124, 0, 47, 0, 62, 29, 77, 77, 77, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 124, 0, 47, 0, 71, 29, 77, 77, 77, 77, 77, 77, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 124, 0, 47, 0, 68, 29, 77, 77, 77, 77, 77, 77, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 33, 47, 33, 80, 0, 0, 35, 0, 0, 86, 83, 37, 89, 83, 89, 89, 89, 89, 89, 89, 89, 92, 0, 0 ]; const _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 ]; const lexer_start = 1; const lexer_first_final = 287; const lexer_error = 0; const lexer_en_main = 1; /* line 120 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ /* line 121 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ /* line 122 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ var Lexer = function(listener) { // Check that listener has the required functions var events = ['comment', 'tag', 'feature', 'background', 'scenario', 'scenario_outline', 'examples', 'step', 'doc_string', 'row', 'eof']; for(e in events) { var event = events[e]; if(typeof listener[event] != 'function') { "Error. No " + event + " function exists on " + JSON.stringify(listener); } } this.listener = listener; }; Lexer.prototype.scan = function(data) { var ending = "\n%_FEATURE_END_%"; if(typeof data == 'string') { data = this.stringToBytes(data + ending); } else if(typeof Buffer != 'undefined' && Buffer.isBuffer(data)) { // Node.js var buf = new Buffer(data.length + ending.length); data.copy(buf, 0, 0); new Buffer(ending).copy(buf, data.length, 0); data = buf; } var eof = pe = data.length; var p = 0; this.line_number = 1; this.last_newline = 0; /* line 575 "js/lib/gherkin/lexer/id.js" */ { this.cs = lexer_start; } /* JSCodeGen::writeInit */ /* line 153 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ /* line 582 "js/lib/gherkin/lexer/id.js" */ { var _klen, _trans, _keys, _ps, _widec, _acts, _nacts; var _goto_level, _resume, _eof_trans, _again, _test_eof; var _out; _klen = _trans = _keys = _acts = _nacts = null; _goto_level = 0; _resume = 10; _eof_trans = 15; _again = 20; _test_eof = 30; _out = 40; while (true) { _trigger_goto = false; if (_goto_level <= 0) { if (p == pe) { _goto_level = _test_eof; continue; } if ( this.cs == 0) { _goto_level = _out; continue; } } if (_goto_level <= _resume) { _keys = _lexer_key_offsets[ this.cs]; _trans = _lexer_index_offsets[ this.cs]; _klen = _lexer_single_lengths[ this.cs]; _break_match = false; do { if (_klen > 0) { _lower = _keys; _upper = _keys + _klen - 1; while (true) { if (_upper < _lower) { break; } _mid = _lower + ( (_upper - _lower) >> 1 ); if ( data[p] < _lexer_trans_keys[_mid]) { _upper = _mid - 1; } else if ( data[p] > _lexer_trans_keys[_mid]) { _lower = _mid + 1; } else { _trans += (_mid - _keys); _break_match = true; break; }; } /* while */ if (_break_match) { break; } _keys += _klen; _trans += _klen; } _klen = _lexer_range_lengths[ this.cs]; if (_klen > 0) { _lower = _keys; _upper = _keys + (_klen << 1) - 2; while (true) { if (_upper < _lower) { break; } _mid = _lower + (((_upper-_lower) >> 1) & ~1); if ( data[p] < _lexer_trans_keys[_mid]) { _upper = _mid - 2; } else if ( data[p] > _lexer_trans_keys[_mid+1]) { _lower = _mid + 2; } else { _trans += ((_mid - _keys) >> 1); _break_match = true; break; } } /* while */ if (_break_match) { break; } _trans += _klen } } while (false); _trans = _lexer_indicies[_trans]; this.cs = _lexer_trans_targs[_trans]; if (_lexer_trans_actions[_trans] != 0) { _acts = _lexer_trans_actions[_trans]; _nacts = _lexer_actions[_acts]; _acts += 1; while (_nacts > 0) { _nacts -= 1; _acts += 1; switch (_lexer_actions[_acts - 1]) { case 0: /* line 6 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ this.content_start = p; this.current_line = this.line_number; this.start_col = p - this.last_newline - (this.keyword+':').length; break; case 1: /* line 12 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ this.current_line = this.line_number; this.start_col = p - this.last_newline; break; case 2: /* line 17 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ this.content_start = p; break; case 3: /* line 21 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ var con = this.unindent( this.start_col, this.bytesToString(data.slice(this.content_start, this.next_keyword_start-1)).replace(/(\r?\n)?([\t ])*$/, '').replace(/\\\"\\\"\\\"/mg, '"""') ); this.listener.doc_string(con, this.current_line); break; case 4: /* line 29 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ p = this.store_keyword_content('feature', data, p, eof); break; case 5: /* line 33 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ p = this.store_keyword_content('background', data, p, eof); break; case 6: /* line 37 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ p = this.store_keyword_content('scenario', data, p, eof); break; case 7: /* line 41 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ p = this.store_keyword_content('scenario_outline', data, p, eof); break; case 8: /* line 45 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ p = this.store_keyword_content('examples', data, p, eof); break; case 9: /* line 49 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ var con = this.bytesToString(data.slice(this.content_start, p)).trim(); this.listener.step(this.keyword, con, this.current_line); break; case 10: /* line 54 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ var con = this.bytesToString(data.slice(this.content_start, p)).trim(); this.listener.comment(con, this.line_number); this.keyword_start = null; break; case 11: /* line 60 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ var con = this.bytesToString(data.slice(this.content_start, p)).trim(); this.listener.tag(con, this.line_number); this.keyword_start = null; break; case 12: /* line 66 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ this.line_number++; break; case 13: /* line 70 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ this.last_newline = p + 1; break; case 14: /* line 74 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ this.keyword_start = this.keyword_start || p; break; case 15: /* line 78 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ this.keyword = this.bytesToString(data.slice(this.keyword_start, p)).replace(/:$/, ''); this.keyword_start = null; break; case 16: /* line 83 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ this.next_keyword_start = p; break; case 17: /* line 87 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ p = p - 1; current_row = []; this.current_line = this.line_number; break; case 18: /* line 93 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ this.content_start = p; break; case 19: /* line 97 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ var con = this.bytesToString(data.slice(this.content_start, p)).trim(); current_row.push(con.replace(/\\\|/, "|").replace(/\\n/, "\n").replace(/\\\\/, "\\")); break; case 20: /* line 102 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ this.listener.row(current_row, this.current_line); break; case 21: /* line 106 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ if(this.cs < lexer_first_final) { var content = this.current_line_content(data, p); throw "Lexing error on line " + this.line_number + ": '" + content + "'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information."; } else { this.listener.eof(); } break; /* line 798 "js/lib/gherkin/lexer/id.js" */ } /* action switch */ } } if (_trigger_goto) { continue; } } if (_goto_level <= _again) { if ( this.cs == 0) { _goto_level = _out; continue; } p += 1; if (p != pe) { _goto_level = _resume; continue; } } if (_goto_level <= _test_eof) { if (p == eof) { __acts = _lexer_eof_actions[ this.cs]; __nacts = _lexer_actions[__acts]; __acts += 1; while (__nacts > 0) { __nacts -= 1; __acts += 1; switch (_lexer_actions[__acts - 1]) { case 21: /* line 106 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ if(this.cs < lexer_first_final) { var content = this.current_line_content(data, p); throw "Lexing error on line " + this.line_number + ": '" + content + "'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information."; } else { this.listener.eof(); } break; /* line 837 "js/lib/gherkin/lexer/id.js" */ } /* eof action switch */ } if (_trigger_goto) { continue; } } } if (_goto_level <= _out) { break; } } } /* line 154 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/id.js.rl" */ }; Lexer.prototype.bytesToString = function(bytes) { if(typeof bytes.write == 'function') { // Node.js return bytes.toString('utf-8'); } else { var result = ""; for(var b in bytes) { result += String.fromCharCode(bytes[b]); } return result; } }; Lexer.prototype.stringToBytes = function(string) { var bytes = []; for(var i = 0; i < string.length; i++) { bytes[i] = string.charCodeAt(i); } return bytes; }; Lexer.prototype.unindent = function(startcol, text) { startcol = startcol || 0; return text.replace(new RegExp('^[\t ]{0,' + startcol + '}', 'gm'), ''); }; Lexer.prototype.store_keyword_content = function(event, data, p, eof) { var end_point = (!this.next_keyword_start || (p == eof)) ? p : this.next_keyword_start; var content = this.unindent(this.start_col + 2, this.bytesToString(data.slice(this.content_start, end_point))).replace(/\s+$/,""); var content_lines = content.split("\n") var name = content_lines.shift() || ""; name = name.trim(); var description = content_lines.join("\n"); this.listener[event](this.keyword, name, description, this.current_line); var nks = this.next_keyword_start; this.next_keyword_start = null; return nks ? nks - 1 : p; }; Lexer.prototype.current_line_content = function(data, p) { var rest = data.slice(this.last_newline, -1); var end = rest.indexOf(10) || -1; return this.bytesToString(rest.slice(0, end)).trim(); }; // Node.js export if(typeof exports !== 'undefined') { exports.Lexer = Lexer; } // Require.js export if (typeof define !== 'undefined' && define.amd) { define('gherkin/lexer/id', [], function() {return Lexer}); } })();