gherkin
Version:
A fast Gherkin lexer/parser based on the Ragel State Machine Compiler.
966 lines (901 loc) • 30.4 kB
JavaScript
/* line 1 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.js.rl" */
;(function() {
/* line 117 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.js.rl" */
/* line 11 "js/lib/gherkin/lexer/en_tx.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, 111, 112, 113, 114, 115,
116, 117, 118, 119, 120, 121, 136, 138,
140, 142, 144, 146, 148, 150, 152, 154,
156, 158, 160, 162, 164, 166, 184, 186,
187, 188, 189, 190, 191, 192, 193, 194,
195, 196, 197, 212, 214, 216, 218, 220,
222, 224, 226, 228, 230, 232, 234, 236,
238, 240, 242, 245, 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, 316,
317, 318, 319, 320, 321, 322, 323, 324,
325, 326, 327, 328, 329, 330, 331, 332,
339, 341, 343, 345, 347, 349, 351, 353,
354, 355, 356, 357, 358, 359, 360, 361,
362, 374, 376, 378, 380, 382, 384, 386,
388, 390, 392, 394, 396, 398, 400, 402,
404, 406, 408, 410, 412, 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, 464, 466,
468, 470, 472, 474, 476, 478, 479, 480,
481, 482, 483, 484, 485, 486, 487, 488,
489, 490, 491, 492, 507, 509, 511, 513,
515, 517, 519, 521, 523, 525, 527, 529,
531, 533, 535, 537, 540, 542, 544, 546,
548, 550, 552, 554, 556, 558, 560, 562,
564, 566, 568, 570, 573, 575, 577, 579,
581, 583, 585, 587, 589, 591, 593, 595,
597, 599, 601, 603, 605, 607, 609, 611,
613, 615, 617, 619, 621, 623, 625, 627,
628, 632, 638, 641, 643, 649, 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, 726, 727, 728
];
const _lexer_trans_keys = [
10, 32, 34, 35, 37, 42, 64, 65,
66, 69, 70, 71, 83, 84, 87, 124,
239, 9, 13, 10, 32, 34, 35, 37,
42, 64, 65, 66, 69, 70, 71, 83,
84, 87, 124, 9, 13, 34, 34, 10,
32, 9, 13, 10, 32, 34, 9, 13,
10, 32, 34, 9, 13, 10, 32, 34,
9, 13, 10, 32, 34, 9, 13, 10,
32, 9, 13, 10, 32, 9, 13, 10,
13, 10, 95, 70, 69, 65, 84, 85,
82, 69, 95, 69, 78, 68, 95, 37,
32, 10, 10, 13, 13, 32, 64, 9,
10, 9, 10, 13, 32, 64, 11, 12,
10, 32, 64, 9, 13, 108, 110, 108,
32, 121, 39, 97, 108, 108, 58, 10,
10, 10, 32, 35, 37, 42, 64, 65,
66, 70, 71, 83, 84, 87, 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, 65, 66, 69,
70, 71, 83, 84, 87, 124, 9, 13,
97, 117, 99, 107, 103, 114, 111, 117,
110, 100, 58, 10, 10, 10, 32, 35,
37, 42, 64, 65, 66, 70, 71, 83,
84, 87, 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, 110, 10, 108, 10,
32, 10, 121, 10, 39, 10, 97, 10,
108, 10, 108, 10, 58, 10, 100, 10,
32, 10, 121, 10, 39, 10, 97, 10,
108, 10, 108, 10, 117, 10, 116, 10,
101, 10, 97, 10, 116, 10, 117, 10,
114, 10, 101, 10, 105, 10, 118, 10,
101, 10, 110, 10, 99, 10, 101, 10,
110, 10, 97, 10, 114, 10, 105, 10,
111, 10, 104, 116, 32, 121, 39, 97,
108, 108, 120, 97, 109, 112, 108, 101,
115, 58, 10, 10, 10, 32, 35, 70,
124, 9, 13, 10, 101, 10, 97, 10,
116, 10, 117, 10, 114, 10, 101, 10,
58, 101, 97, 116, 117, 114, 101, 58,
10, 10, 10, 32, 35, 37, 64, 65,
66, 69, 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, 108, 10, 108, 10, 32,
10, 121, 10, 39, 10, 97, 10, 108,
10, 108, 10, 58, 10, 97, 10, 99,
10, 107, 10, 103, 10, 114, 10, 111,
10, 117, 10, 110, 10, 100, 10, 120,
10, 97, 10, 109, 10, 112, 10, 108,
10, 101, 10, 115, 10, 101, 10, 97,
10, 116, 10, 117, 10, 114, 10, 101,
10, 99, 10, 101, 10, 110, 10, 97,
10, 114, 10, 105, 10, 111, 105, 118,
101, 110, 99, 101, 110, 97, 114, 105,
111, 58, 10, 10, 10, 32, 35, 37,
42, 64, 65, 66, 70, 71, 83, 84,
87, 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, 110, 10, 108, 10, 32,
10, 121, 10, 39, 10, 97, 10, 108,
10, 108, 10, 58, 10, 100, 10, 32,
10, 121, 10, 39, 10, 97, 10, 108,
10, 108, 10, 97, 117, 10, 99, 10,
107, 10, 103, 10, 114, 10, 111, 10,
117, 10, 110, 10, 100, 10, 116, 10,
101, 10, 97, 10, 116, 10, 117, 10,
114, 10, 101, 10, 105, 10, 118, 10,
101, 10, 110, 10, 99, 10, 101, 10,
110, 10, 97, 10, 114, 10, 105, 10,
111, 10, 104, 104, 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, 66, 69, 70, 71, 83, 84, 87,
124, 9, 13, 10, 110, 10, 100, 10,
32, 10, 121, 10, 39, 10, 97, 10,
108, 10, 108, 10, 117, 10, 116, 10,
101, 10, 97, 10, 116, 10, 117, 10,
114, 10, 101, 10, 58, 10, 105, 10,
118, 10, 101, 10, 110, 10, 99, 10,
101, 10, 110, 10, 97, 10, 114, 10,
105, 10, 111, 10, 104, 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, 2, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 13, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 16, 2, 1,
1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 13, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 3, 2, 2, 2, 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,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 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,
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, 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,
1, 1, 0, 0, 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, 0, 0, 0, 0, 0
];
const _lexer_index_offsets = [
0, 0, 19, 37, 39, 41, 45, 50,
55, 60, 65, 69, 73, 76, 78, 80,
82, 84, 86, 88, 90, 92, 94, 96,
98, 100, 102, 104, 106, 108, 110, 113,
118, 125, 130, 133, 135, 137, 139, 141,
143, 145, 147, 149, 151, 153, 168, 171,
174, 177, 180, 183, 186, 189, 192, 195,
198, 201, 204, 207, 210, 213, 231, 234,
236, 238, 240, 242, 244, 246, 248, 250,
252, 254, 256, 271, 274, 277, 280, 283,
286, 289, 292, 295, 298, 301, 304, 307,
310, 313, 316, 320, 323, 326, 329, 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, 427,
429, 431, 433, 435, 437, 439, 441, 443,
445, 447, 449, 451, 453, 455, 457, 459,
466, 469, 472, 475, 478, 481, 484, 487,
489, 491, 493, 495, 497, 499, 501, 503,
505, 517, 520, 523, 526, 529, 532, 535,
538, 541, 544, 547, 550, 553, 556, 559,
562, 565, 568, 571, 574, 577, 580, 583,
586, 589, 592, 595, 598, 601, 604, 607,
610, 613, 616, 619, 622, 625, 628, 631,
634, 637, 640, 643, 646, 649, 652, 655,
658, 661, 664, 667, 670, 673, 675, 677,
679, 681, 683, 685, 687, 689, 691, 693,
695, 697, 699, 701, 716, 719, 722, 725,
728, 731, 734, 737, 740, 743, 746, 749,
752, 755, 758, 761, 765, 768, 771, 774,
777, 780, 783, 786, 789, 792, 795, 798,
801, 804, 807, 810, 814, 817, 820, 823,
826, 829, 832, 835, 838, 841, 844, 847,
850, 853, 856, 859, 862, 865, 868, 871,
874, 877, 880, 883, 886, 889, 892, 895,
897, 901, 907, 911, 914, 920, 938, 941,
944, 947, 950, 953, 956, 959, 962, 965,
968, 971, 974, 977, 980, 983, 986, 989,
992, 995, 998, 1001, 1004, 1007, 1010, 1013,
1016, 1019, 1022, 1025, 1027, 1029, 1031
];
const _lexer_indicies = [
2, 1, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 14, 15,
16, 1, 0, 2, 1, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12, 13,
14, 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, 62, 0, 63, 0, 64,
0, 65, 0, 66, 0, 67, 0, 68,
0, 69, 0, 70, 0, 72, 71, 74,
73, 74, 75, 76, 77, 78, 76, 79,
80, 81, 82, 83, 84, 84, 75, 73,
74, 85, 73, 74, 86, 73, 74, 87,
73, 74, 88, 73, 74, 89, 73, 74,
90, 73, 74, 91, 73, 74, 92, 73,
74, 93, 73, 74, 94, 73, 74, 95,
73, 74, 96, 73, 74, 97, 73, 74,
98, 73, 74, 99, 73, 101, 100, 102,
103, 104, 105, 106, 107, 108, 109, 110,
111, 112, 113, 113, 114, 100, 0, 115,
116, 0, 117, 0, 118, 0, 119, 0,
120, 0, 121, 0, 122, 0, 123, 0,
124, 0, 125, 0, 127, 126, 129, 128,
129, 130, 131, 132, 133, 131, 134, 135,
136, 137, 138, 139, 139, 130, 128, 129,
140, 128, 129, 141, 128, 129, 142, 128,
129, 143, 128, 129, 144, 128, 129, 145,
128, 129, 146, 128, 129, 147, 128, 129,
148, 128, 129, 149, 128, 129, 150, 128,
129, 151, 128, 129, 152, 128, 129, 153,
128, 129, 154, 128, 129, 155, 156, 128,
129, 157, 128, 129, 158, 128, 129, 159,
128, 129, 160, 128, 129, 161, 128, 129,
162, 128, 129, 163, 128, 129, 154, 128,
129, 164, 128, 129, 165, 128, 129, 166,
128, 129, 167, 128, 129, 168, 128, 129,
169, 128, 129, 170, 128, 129, 171, 128,
129, 164, 128, 129, 172, 128, 129, 173,
128, 129, 174, 128, 129, 175, 128, 129,
176, 128, 129, 163, 128, 129, 177, 128,
129, 178, 128, 129, 179, 128, 129, 164,
128, 129, 180, 128, 129, 181, 128, 129,
182, 128, 129, 183, 128, 129, 184, 128,
129, 185, 128, 129, 163, 128, 129, 178,
128, 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, 200, 0, 202,
201, 204, 203, 204, 205, 206, 207, 206,
205, 203, 204, 208, 203, 204, 209, 203,
204, 210, 203, 204, 211, 203, 204, 212,
203, 204, 213, 203, 204, 214, 203, 215,
0, 216, 0, 217, 0, 218, 0, 219,
0, 220, 0, 221, 0, 223, 222, 225,
224, 225, 226, 227, 228, 227, 229, 230,
231, 232, 233, 226, 224, 225, 234, 224,
225, 235, 224, 225, 236, 224, 225, 237,
224, 225, 238, 224, 225, 239, 224, 225,
240, 224, 225, 241, 224, 225, 242, 224,
225, 243, 224, 225, 244, 224, 225, 245,
224, 225, 246, 224, 225, 247, 224, 225,
248, 224, 225, 249, 224, 225, 250, 224,
225, 251, 224, 225, 252, 224, 225, 253,
224, 225, 254, 224, 225, 255, 224, 225,
256, 224, 225, 257, 224, 225, 258, 224,
225, 259, 224, 225, 260, 224, 225, 261,
224, 225, 262, 224, 225, 263, 224, 225,
264, 224, 225, 255, 224, 225, 265, 224,
225, 266, 224, 225, 267, 224, 225, 268,
224, 225, 269, 224, 225, 270, 224, 225,
255, 224, 225, 271, 224, 225, 272, 224,
225, 273, 224, 225, 274, 224, 225, 275,
224, 225, 255, 224, 225, 276, 224, 225,
277, 224, 225, 278, 224, 225, 279, 224,
225, 280, 224, 225, 281, 224, 225, 255,
224, 282, 0, 283, 0, 284, 0, 186,
0, 285, 0, 286, 0, 287, 0, 288,
0, 289, 0, 290, 0, 291, 0, 292,
0, 294, 293, 296, 295, 296, 297, 298,
299, 300, 298, 301, 302, 303, 304, 305,
306, 306, 297, 295, 296, 307, 295, 296,
308, 295, 296, 309, 295, 296, 310, 295,
296, 311, 295, 296, 312, 295, 296, 313,
295, 296, 314, 295, 296, 315, 295, 296,
316, 295, 296, 317, 295, 296, 318, 295,
296, 319, 295, 296, 320, 295, 296, 321,
295, 296, 322, 323, 295, 296, 324, 295,
296, 325, 295, 296, 326, 295, 296, 327,
295, 296, 328, 295, 296, 329, 295, 296,
330, 295, 296, 321, 295, 296, 331, 295,
296, 332, 295, 296, 333, 295, 296, 334,
295, 296, 335, 295, 296, 336, 295, 296,
337, 295, 296, 338, 339, 295, 296, 340,
295, 296, 341, 295, 296, 342, 295, 296,
343, 295, 296, 344, 295, 296, 345, 295,
296, 346, 295, 296, 330, 295, 296, 331,
295, 296, 347, 295, 296, 348, 295, 296,
349, 295, 296, 350, 295, 296, 351, 295,
296, 330, 295, 296, 352, 295, 296, 353,
295, 296, 354, 295, 296, 331, 295, 296,
355, 295, 296, 356, 295, 296, 357, 295,
296, 358, 295, 296, 359, 295, 296, 360,
295, 296, 330, 295, 296, 353, 295, 283,
0, 361, 362, 361, 0, 365, 364, 366,
367, 364, 363, 0, 369, 370, 368, 0,
369, 368, 365, 371, 369, 370, 371, 368,
365, 372, 373, 374, 375, 376, 377, 378,
379, 380, 381, 382, 383, 384, 384, 385,
372, 0, 74, 386, 73, 74, 387, 73,
74, 388, 73, 74, 389, 73, 74, 390,
73, 74, 391, 73, 74, 392, 73, 74,
393, 73, 74, 394, 73, 74, 387, 73,
74, 395, 73, 74, 396, 73, 74, 397,
73, 74, 398, 73, 74, 399, 73, 74,
400, 73, 74, 99, 73, 74, 401, 73,
74, 402, 73, 74, 403, 73, 74, 387,
73, 74, 404, 73, 74, 405, 73, 74,
406, 73, 74, 407, 73, 74, 408, 73,
74, 409, 73, 74, 400, 73, 74, 402,
73, 186, 0, 410, 0, 1, 0, 411,
0
];
const _lexer_trans_targs = [
0, 2, 2, 3, 12, 14, 28, 31,
34, 62, 133, 151, 213, 217, 287, 288,
324, 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, 326, 29, 30, 30, 2, 13, 32,
33, 2, 32, 31, 33, 35, 323, 36,
37, 38, 39, 40, 41, 42, 43, 44,
45, 44, 45, 45, 2, 46, 60, 294,
302, 304, 311, 315, 322, 47, 48, 49,
50, 51, 52, 53, 54, 55, 56, 57,
58, 59, 2, 61, 2, 2, 3, 12,
14, 28, 31, 34, 62, 133, 151, 213,
217, 287, 288, 63, 126, 64, 65, 66,
67, 68, 69, 70, 71, 72, 73, 74,
73, 74, 74, 2, 75, 89, 90, 106,
108, 114, 118, 125, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87,
88, 2, 61, 91, 99, 92, 93, 94,
95, 96, 97, 98, 100, 101, 102, 103,
104, 105, 89, 107, 109, 110, 111, 112,
113, 115, 116, 117, 119, 120, 121, 122,
123, 124, 127, 128, 129, 130, 131, 132,
28, 134, 135, 136, 137, 138, 139, 140,
141, 142, 143, 142, 143, 143, 2, 144,
145, 146, 147, 148, 149, 150, 61, 152,
153, 154, 155, 156, 157, 158, 159, 160,
159, 160, 160, 2, 161, 175, 184, 193,
200, 206, 162, 163, 164, 165, 166, 167,
168, 169, 170, 171, 172, 173, 174, 2,
176, 177, 178, 179, 180, 181, 182, 183,
61, 185, 186, 187, 188, 189, 190, 191,
192, 194, 195, 196, 197, 198, 199, 201,
202, 203, 204, 205, 207, 208, 209, 210,
211, 212, 214, 215, 216, 218, 219, 220,
221, 222, 223, 224, 225, 226, 227, 226,
227, 227, 2, 228, 242, 243, 259, 269,
275, 279, 286, 229, 230, 231, 232, 233,
234, 235, 236, 237, 238, 239, 240, 241,
2, 61, 244, 252, 245, 246, 247, 248,
249, 250, 251, 253, 254, 255, 256, 257,
258, 242, 260, 268, 261, 262, 263, 264,
265, 266, 267, 270, 271, 272, 273, 274,
276, 277, 278, 280, 281, 282, 283, 284,
285, 288, 289, 290, 292, 293, 291, 289,
290, 291, 289, 292, 293, 3, 12, 14,
28, 31, 34, 62, 133, 151, 213, 217,
287, 288, 295, 296, 297, 298, 299, 300,
301, 60, 303, 305, 306, 307, 308, 309,
310, 312, 313, 314, 316, 317, 318, 319,
320, 321, 325, 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, 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, 0, 0, 86, 83, 37,
89, 83, 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
];
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
];
const lexer_start = 1;
const lexer_first_final = 326;
const lexer_error = 0;
const lexer_en_main = 1;
/* line 120 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.js.rl" */
/* line 121 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.js.rl" */
/* line 122 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.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 633 "js/lib/gherkin/lexer/en_tx.js" */
{
this.cs = lexer_start;
} /* JSCodeGen::writeInit */
/* line 153 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.js.rl" */
/* line 640 "js/lib/gherkin/lexer/en_tx.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/en_tx.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/en_tx.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/en_tx.js.rl" */
this.content_start = p;
break;
case 3:
/* line 21 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.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/en_tx.js.rl" */
p = this.store_keyword_content('feature', data, p, eof);
break;
case 5:
/* line 33 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.js.rl" */
p = this.store_keyword_content('background', data, p, eof);
break;
case 6:
/* line 37 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.js.rl" */
p = this.store_keyword_content('scenario', data, p, eof);
break;
case 7:
/* line 41 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.js.rl" */
p = this.store_keyword_content('scenario_outline', data, p, eof);
break;
case 8:
/* line 45 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.js.rl" */
p = this.store_keyword_content('examples', data, p, eof);
break;
case 9:
/* line 49 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.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/en_tx.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/en_tx.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/en_tx.js.rl" */
this.line_number++;
break;
case 13:
/* line 70 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.js.rl" */
this.last_newline = p + 1;
break;
case 14:
/* line 74 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.js.rl" */
this.keyword_start = this.keyword_start || p;
break;
case 15:
/* line 78 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.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/en_tx.js.rl" */
this.next_keyword_start = p;
break;
case 17:
/* line 87 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.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/en_tx.js.rl" */
this.content_start = p;
break;
case 19:
/* line 97 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.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/en_tx.js.rl" */
this.listener.row(current_row, this.current_line);
break;
case 21:
/* line 106 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.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 856 "js/lib/gherkin/lexer/en_tx.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/en_tx.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 895 "js/lib/gherkin/lexer/en_tx.js" */
} /* eof action switch */
}
if (_trigger_goto) {
continue;
}
}
}
if (_goto_level <= _out) {
break;
}
}
}
/* line 154 "/Users/ahellesoy/scm/gherkin/tasks/../ragel/i18n/en_tx.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/en_tx', [], function() {return Lexer});
}
})();