UNPKG

gherkin

Version:

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

996 lines (931 loc) 31.3 kB
/* line 1 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.js.rl" */ ;(function() { /* line 117 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.js.rl" */ /* line 11 "js/lib/gherkin/lexer/lt.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, 19, 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, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 212, 214, 216, 218, 220, 222, 224, 226, 228, 229, 230, 231, 232, 233, 234, 235, 236, 247, 249, 251, 253, 255, 257, 259, 261, 263, 265, 267, 269, 271, 273, 275, 277, 279, 281, 283, 285, 287, 289, 291, 293, 295, 297, 299, 301, 303, 305, 307, 309, 311, 313, 315, 318, 320, 322, 324, 326, 328, 330, 332, 334, 336, 338, 340, 343, 346, 348, 350, 352, 354, 356, 358, 360, 362, 364, 366, 368, 370, 372, 374, 376, 377, 378, 379, 380, 381, 382, 384, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 414, 416, 418, 420, 422, 424, 426, 428, 430, 432, 434, 436, 438, 440, 442, 444, 446, 448, 450, 452, 454, 456, 458, 460, 462, 465, 467, 469, 471, 473, 475, 477, 479, 481, 483, 485, 487, 489, 491, 493, 495, 497, 498, 499, 500, 501, 515, 517, 519, 521, 523, 525, 527, 529, 531, 533, 535, 537, 539, 541, 543, 545, 547, 549, 551, 553, 555, 557, 559, 562, 564, 566, 568, 570, 572, 574, 576, 578, 580, 582, 585, 587, 589, 591, 593, 595, 597, 599, 601, 603, 605, 607, 610, 612, 614, 616, 618, 620, 622, 624, 626, 628, 630, 632, 634, 635, 636, 637, 638, 639, 640, 641, 642, 646, 652, 655, 657, 663, 681, 683, 685, 687, 689, 691, 693, 695, 697, 699, 702, 704, 706, 708, 710, 712, 714, 716, 718, 720, 722, 724, 726, 729, 731, 733, 735, 737, 739, 741, 743, 745, 747, 749, 751, 753, 755, 757, 758, 759 ]; const _lexer_trans_keys = [ 10, 32, 34, 35, 37, 42, 64, 66, 68, 73, 75, 80, 83, 84, 86, 124, 239, 9, 13, 10, 32, 34, 35, 37, 42, 64, 66, 68, 73, 75, 80, 83, 84, 86, 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, 101, 116, 117, 111, 116, 97, 114, 97, 111, 105, 110, 116, 101, 107, 115, 116, 97, 115, 58, 10, 10, 10, 32, 35, 37, 42, 64, 66, 68, 73, 75, 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, 32, 34, 35, 37, 42, 64, 66, 68, 73, 75, 80, 83, 84, 86, 124, 9, 13, 97, 118, 121, 122, 100, -59, -66, 105, 97, 105, 58, 10, 10, 10, 32, 35, 83, 124, 9, 13, 10, 97, 10, 118, 10, 121, 10, 98, -60, 10, -105, 10, 10, 58, 97, 99, 118, 121, 98, -60, -105, 58, 10, 10, 10, 32, 35, 37, 64, 75, 80, 83, 86, 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, 101, 10, 107, 10, 115, 10, 116, 10, 97, 10, 115, 10, 58, 10, 97, 10, 118, 10, 121, 10, 122, 10, 100, -59, 10, -66, 10, 10, 105, 10, 97, 10, 105, 10, 97, 99, 10, 118, 10, 121, 10, 98, -60, 10, -105, 10, 10, 101, 10, 110, 10, 97, 10, 114, 10, 105, 10, 106, 10, 97, 117, 10, 105, 117, 10, 115, 10, 32, -59, 10, -95, 10, 10, 97, 10, 98, 10, 108, 10, 111, 10, 110, 10, 97, 10, 114, 10, 105, 10, 97, 10, 110, 10, 116, 101, 110, 97, 114, 105, 106, 97, 117, 105, 117, 115, 32, -59, -95, 97, 98, 108, 111, 110, 97, 115, 58, 10, 10, 10, 32, 35, 37, 42, 64, 66, 68, 73, 75, 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, 101, 10, 116, 10, 117, 10, 111, 10, 116, 10, 97, 10, 114, 10, 97, 10, 105, 10, 97, 99, 10, 118, 10, 121, 10, 98, -60, 10, -105, 10, 10, 58, 10, 101, 10, 110, 10, 97, 10, 114, 10, 105, 10, 106, 10, 117, 10, 115, 10, 97, 10, 100, 115, 58, 10, 10, 10, 32, 35, 37, 42, 64, 66, 68, 73, 75, 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, 101, 10, 116, 10, 117, 10, 111, 10, 116, 10, 97, 10, 114, 10, 97, 111, 10, 105, 10, 110, 10, 116, 10, 101, 10, 107, 10, 115, 10, 116, 10, 97, 10, 115, 10, 58, 10, 97, 99, 10, 118, 10, 121, 10, 98, -60, 10, -105, 10, 10, 101, 10, 110, 10, 97, 10, 114, 10, 105, 10, 106, 10, 97, 117, 10, 117, 10, 115, 10, 32, -59, 10, -95, 10, 10, 97, 10, 98, 10, 108, 10, 111, 10, 110, 10, 97, 10, 100, 97, 100, 97, 114, 105, 97, 110, 116, 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, 66, 68, 73, 75, 80, 83, 84, 86, 124, 9, 13, 10, 101, 10, 116, 10, 117, 10, 111, 10, 116, 10, 97, 10, 114, 10, 97, 10, 105, 10, 97, 99, 10, 118, 10, 121, 10, 98, -60, 10, -105, 10, 10, 58, 10, 101, 10, 110, 10, 97, 10, 114, 10, 105, 10, 106, 10, 97, 117, 10, 117, 10, 115, 10, 32, -59, 10, -95, 10, 10, 97, 10, 98, 10, 108, 10, 111, 10, 110, 10, 97, 10, 115, 10, 97, 10, 100, 187, 191, 0 ]; const _lexer_single_lengths = [ 0, 17, 16, 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, 2, 1, 1, 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, 98, 100, 102, 104, 106, 108, 110, 113, 118, 125, 130, 132, 134, 136, 138, 140, 142, 144, 147, 149, 151, 153, 155, 157, 159, 161, 163, 165, 167, 169, 171, 185, 188, 191, 194, 197, 200, 203, 206, 209, 212, 215, 218, 221, 224, 227, 230, 248, 250, 252, 254, 256, 258, 260, 262, 264, 266, 268, 270, 272, 274, 281, 284, 287, 290, 293, 296, 299, 302, 305, 307, 309, 311, 313, 315, 317, 319, 321, 332, 335, 338, 341, 344, 347, 350, 353, 356, 359, 362, 365, 368, 371, 374, 377, 380, 383, 386, 389, 392, 395, 398, 401, 404, 407, 410, 413, 416, 419, 422, 425, 428, 431, 434, 438, 441, 444, 447, 450, 453, 456, 459, 462, 465, 468, 471, 475, 479, 482, 485, 488, 491, 494, 497, 500, 503, 506, 509, 512, 515, 518, 521, 524, 526, 528, 530, 532, 534, 536, 539, 542, 544, 546, 548, 550, 552, 554, 556, 558, 560, 562, 564, 566, 568, 570, 584, 587, 590, 593, 596, 599, 602, 605, 608, 611, 614, 617, 620, 623, 626, 629, 632, 635, 638, 641, 644, 647, 650, 653, 656, 660, 663, 666, 669, 672, 675, 678, 681, 684, 687, 690, 693, 696, 699, 702, 705, 708, 710, 712, 714, 716, 730, 733, 736, 739, 742, 745, 748, 751, 754, 757, 760, 763, 766, 769, 772, 775, 778, 781, 784, 787, 790, 793, 796, 800, 803, 806, 809, 812, 815, 818, 821, 824, 827, 830, 834, 837, 840, 843, 846, 849, 852, 855, 858, 861, 864, 867, 871, 874, 877, 880, 883, 886, 889, 892, 895, 898, 901, 904, 907, 909, 911, 913, 915, 917, 919, 921, 923, 927, 933, 937, 940, 946, 964, 967, 970, 973, 976, 979, 982, 985, 988, 991, 995, 998, 1001, 1004, 1007, 1010, 1013, 1016, 1019, 1022, 1025, 1028, 1031, 1035, 1038, 1041, 1044, 1047, 1050, 1053, 1056, 1059, 1062, 1065, 1068, 1071, 1074, 1077, 1079, 1081 ]; const _lexer_indicies = [ 2, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1, 0, 2, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 0, 18, 0, 19, 0, 20, 19, 19, 0, 23, 22, 24, 22, 21, 27, 26, 28, 26, 25, 27, 26, 29, 26, 25, 27, 26, 30, 26, 25, 32, 31, 31, 0, 2, 33, 33, 0, 35, 36, 34, 2, 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, 51, 0, 0, 52, 54, 55, 53, 0, 0, 0, 0, 56, 57, 58, 57, 57, 60, 59, 56, 2, 61, 7, 61, 0, 62, 0, 63, 0, 64, 0, 65, 0, 66, 0, 63, 0, 63, 0, 67, 68, 0, 63, 0, 69, 0, 70, 0, 71, 0, 72, 0, 73, 0, 74, 0, 75, 0, 76, 0, 77, 0, 79, 78, 81, 80, 81, 82, 83, 84, 85, 83, 86, 87, 88, 89, 90, 91, 82, 80, 81, 92, 80, 81, 93, 80, 81, 94, 80, 81, 95, 80, 81, 96, 80, 81, 97, 80, 81, 98, 80, 81, 99, 80, 81, 100, 80, 81, 101, 80, 81, 102, 80, 81, 103, 80, 81, 104, 80, 81, 105, 80, 81, 106, 80, 108, 107, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 107, 0, 123, 0, 124, 0, 125, 0, 126, 0, 127, 0, 128, 0, 129, 0, 130, 0, 131, 0, 132, 0, 133, 0, 135, 134, 137, 136, 137, 138, 139, 140, 139, 138, 136, 137, 141, 136, 137, 142, 136, 137, 143, 136, 137, 144, 136, 145, 137, 136, 146, 137, 136, 137, 147, 136, 148, 149, 0, 150, 0, 151, 0, 152, 0, 153, 0, 154, 0, 155, 0, 157, 156, 159, 158, 159, 160, 161, 162, 161, 163, 164, 165, 166, 160, 158, 159, 167, 158, 159, 168, 158, 159, 169, 158, 159, 170, 158, 159, 171, 158, 159, 172, 158, 159, 173, 158, 159, 174, 158, 159, 175, 158, 159, 176, 158, 159, 177, 158, 159, 178, 158, 159, 179, 158, 159, 180, 158, 159, 181, 158, 159, 182, 158, 159, 183, 158, 159, 184, 158, 159, 185, 158, 159, 186, 158, 159, 187, 158, 159, 188, 158, 159, 189, 158, 159, 190, 158, 159, 191, 158, 159, 192, 158, 159, 193, 158, 159, 194, 158, 159, 195, 158, 196, 159, 158, 197, 159, 158, 159, 198, 158, 159, 199, 158, 159, 189, 158, 159, 200, 201, 158, 159, 202, 158, 159, 203, 158, 159, 204, 158, 205, 159, 158, 189, 159, 158, 159, 206, 158, 159, 207, 158, 159, 208, 158, 159, 209, 158, 159, 210, 158, 159, 211, 158, 159, 212, 188, 158, 159, 189, 213, 158, 159, 214, 158, 159, 215, 158, 216, 159, 158, 217, 159, 158, 159, 218, 158, 159, 219, 158, 159, 220, 158, 159, 221, 158, 159, 187, 158, 159, 222, 158, 159, 223, 158, 159, 224, 158, 159, 225, 158, 159, 226, 158, 159, 198, 158, 227, 0, 228, 0, 229, 0, 230, 0, 231, 0, 232, 0, 233, 234, 0, 132, 235, 0, 236, 0, 237, 0, 238, 0, 239, 0, 240, 0, 241, 0, 242, 0, 243, 0, 244, 0, 245, 0, 246, 0, 247, 0, 249, 248, 251, 250, 251, 252, 253, 254, 255, 253, 256, 257, 258, 259, 260, 261, 252, 250, 251, 262, 250, 251, 263, 250, 251, 264, 250, 251, 265, 250, 251, 266, 250, 251, 267, 250, 251, 268, 250, 251, 269, 250, 251, 270, 250, 251, 271, 250, 251, 272, 250, 251, 273, 250, 251, 274, 250, 251, 275, 250, 251, 276, 250, 251, 277, 250, 251, 278, 250, 251, 279, 250, 251, 280, 250, 251, 281, 250, 251, 278, 250, 251, 278, 250, 251, 282, 250, 251, 278, 250, 251, 283, 284, 250, 251, 285, 250, 251, 286, 250, 251, 287, 250, 288, 251, 250, 289, 251, 250, 251, 276, 250, 251, 290, 250, 251, 291, 250, 251, 292, 250, 251, 293, 250, 251, 294, 250, 251, 295, 250, 251, 296, 250, 251, 289, 250, 251, 297, 250, 251, 281, 250, 298, 0, 299, 0, 301, 300, 303, 302, 303, 304, 305, 306, 307, 305, 308, 309, 310, 311, 312, 313, 304, 302, 303, 314, 302, 303, 315, 302, 303, 316, 302, 303, 317, 302, 303, 318, 302, 303, 319, 302, 303, 320, 302, 303, 321, 302, 303, 322, 302, 303, 323, 302, 303, 324, 302, 303, 325, 302, 303, 326, 302, 303, 327, 302, 303, 328, 302, 303, 329, 302, 303, 330, 302, 303, 331, 302, 303, 332, 302, 303, 333, 302, 303, 330, 302, 303, 330, 302, 303, 334, 335, 302, 303, 330, 302, 303, 336, 302, 303, 337, 302, 303, 338, 302, 303, 339, 302, 303, 340, 302, 303, 341, 302, 303, 342, 302, 303, 343, 302, 303, 328, 302, 303, 344, 345, 302, 303, 346, 302, 303, 347, 302, 303, 348, 302, 349, 303, 302, 343, 303, 302, 303, 350, 302, 303, 351, 302, 303, 352, 302, 303, 353, 302, 303, 354, 302, 303, 355, 302, 303, 356, 342, 302, 303, 357, 302, 303, 358, 302, 303, 359, 302, 360, 303, 302, 361, 303, 302, 303, 362, 302, 303, 363, 302, 303, 364, 302, 303, 365, 302, 303, 341, 302, 303, 366, 302, 303, 333, 302, 367, 0, 66, 0, 368, 0, 369, 0, 370, 0, 371, 0, 372, 0, 130, 0, 373, 374, 373, 0, 377, 376, 378, 379, 376, 375, 0, 381, 382, 380, 0, 381, 380, 377, 383, 381, 382, 383, 380, 377, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 384, 0, 81, 399, 80, 81, 400, 80, 81, 401, 80, 81, 402, 80, 81, 403, 80, 81, 400, 80, 81, 400, 80, 81, 404, 80, 81, 400, 80, 81, 405, 406, 80, 81, 407, 80, 81, 408, 80, 81, 409, 80, 410, 81, 80, 411, 81, 80, 81, 106, 80, 81, 412, 80, 81, 413, 80, 81, 414, 80, 81, 415, 80, 81, 416, 80, 81, 417, 80, 81, 418, 419, 80, 81, 420, 80, 81, 421, 80, 81, 422, 80, 423, 81, 80, 424, 81, 80, 81, 425, 80, 81, 426, 80, 81, 427, 80, 81, 428, 80, 81, 429, 80, 81, 419, 80, 81, 411, 80, 81, 430, 80, 81, 403, 80, 431, 0, 1, 0, 432, 0 ]; const _lexer_trans_targs = [ 0, 2, 2, 3, 12, 14, 28, 31, 34, 36, 40, 41, 71, 92, 292, 294, 300, 343, 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, 345, 29, 30, 30, 2, 13, 32, 33, 2, 32, 31, 33, 35, 28, 37, 38, 39, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 53, 54, 54, 2, 55, 69, 306, 308, 312, 313, 315, 341, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 2, 70, 2, 2, 3, 12, 14, 28, 31, 34, 36, 40, 41, 71, 92, 292, 294, 300, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 83, 84, 84, 2, 85, 86, 87, 88, 89, 90, 91, 70, 93, 165, 94, 95, 96, 97, 98, 99, 100, 101, 100, 101, 101, 2, 102, 116, 126, 136, 159, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 2, 117, 118, 119, 120, 121, 122, 123, 124, 125, 70, 127, 128, 129, 130, 131, 132, 133, 134, 135, 137, 142, 138, 139, 140, 141, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 160, 161, 162, 163, 164, 166, 167, 168, 169, 170, 171, 172, 229, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 186, 187, 187, 2, 188, 202, 203, 205, 209, 210, 212, 227, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 2, 70, 204, 202, 206, 207, 208, 211, 213, 219, 214, 215, 216, 217, 218, 220, 221, 222, 223, 224, 225, 226, 228, 230, 231, 232, 233, 232, 233, 233, 2, 234, 248, 249, 251, 255, 256, 267, 290, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 2, 70, 250, 248, 252, 253, 254, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 268, 273, 269, 270, 271, 272, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 291, 293, 295, 296, 297, 298, 299, 300, 301, 302, 304, 305, 303, 301, 302, 303, 301, 304, 305, 3, 12, 14, 28, 31, 34, 36, 40, 41, 71, 92, 292, 294, 300, 307, 69, 309, 310, 311, 314, 316, 322, 317, 318, 319, 320, 321, 323, 324, 325, 326, 327, 328, 329, 340, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 342, 344, 0 ]; const _lexer_trans_actions = [ 39, 0, 47, 3, 1, 0, 25, 1, 25, 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, 0, 0, 0, 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, 27, 115, 53, 50, 27, 56, 50, 56, 56, 56, 56, 56, 56, 56, 56, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 124, 0, 47, 0, 74, 77, 0, 0, 0, 0, 0, 0, 17, 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, 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, 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, 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, 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, 89, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 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 = 345; const lexer_error = 0; const lexer_en_main = 1; /* line 120 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.js.rl" */ /* line 121 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.js.rl" */ /* line 122 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.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 663 "js/lib/gherkin/lexer/lt.js" */ { this.cs = lexer_start; } /* JSCodeGen::writeInit */ /* line 153 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.js.rl" */ /* line 670 "js/lib/gherkin/lexer/lt.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/lt.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/lt.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/lt.js.rl" */ this.content_start = p; break; case 3: /* line 21 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.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/lt.js.rl" */ p = this.store_keyword_content('feature', data, p, eof); break; case 5: /* line 33 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.js.rl" */ p = this.store_keyword_content('background', data, p, eof); break; case 6: /* line 37 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.js.rl" */ p = this.store_keyword_content('scenario', data, p, eof); break; case 7: /* line 41 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.js.rl" */ p = this.store_keyword_content('scenario_outline', data, p, eof); break; case 8: /* line 45 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.js.rl" */ p = this.store_keyword_content('examples', data, p, eof); break; case 9: /* line 49 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.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/lt.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/lt.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/lt.js.rl" */ this.line_number++; break; case 13: /* line 70 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.js.rl" */ this.last_newline = p + 1; break; case 14: /* line 74 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.js.rl" */ this.keyword_start = this.keyword_start || p; break; case 15: /* line 78 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.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/lt.js.rl" */ this.next_keyword_start = p; break; case 17: /* line 87 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.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/lt.js.rl" */ this.content_start = p; break; case 19: /* line 97 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.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/lt.js.rl" */ this.listener.row(current_row, this.current_line); break; case 21: /* line 106 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.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 886 "js/lib/gherkin/lexer/lt.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/lt.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 925 "js/lib/gherkin/lexer/lt.js" */ } /* eof action switch */ } if (_trigger_goto) { continue; } } } if (_goto_level <= _out) { break; } } } /* line 154 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/lt.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/lt', [], function() {return Lexer}); } })();