class Gherkin::RbLexer::Sv
:nodoc:
def current_line_content(data, p)
def current_line_content(data, p) rest = data[@last_newline..-1] rest[0..rest.index(10)||-1].utf8_pack("c*").strip end
def initialize(listener)
def initialize(listener) @listener = listener 16 "lib/gherkin/rb_lexer/sv.rb" << self accessor :_lexer_actions te :_lexer_actions, :_lexer_actions= lexer_actions = [ 0, 1, 1, 1, 2, 1, 4, 1, 5, 1, 6, 1, 9, 1, 10, 1, 11, 1, , 15, 1, 16, 1, 17, 1, , 19, 1, 20, 1, 21, 2, , 2, 11, 0, 2, 12, 13, , 0, 2, 15, 1, 2, 15, , 15, 17, 2, 16, 4, 2, , 2, 16, 6, 2, 16, 7, , 8, 2, 16, 14, 2, 18, , 20, 0, 2, 20, 1, 2, 4, 2, 20, 17, 3, 3, 12, , 9, 12, 13, 3, 10, 12, , 11, 12, 13, 3, 12, 13, , 15, 12, 13, 4, 2, 12, 6, 4, 15, 0, 12, 13 << self accessor :_lexer_key_offsets te :_lexer_key_offsets, :_lexer_key_offsets= lexer_key_offsets = [ 18, 19, 20, 24, 29, 34, 4, 48, 52, 54, 55, 56, 57, 9, 60, 61, 62, 63, 64, 65, 7, 68, 69, 70, 71, 73, 78, 0, 91, 92, 93, 94, 95, 96, 8, 99, 100, 101, 102, 103, 104, 106, 107, 108, 109, 122, 124, 126, 130, 132, 134, 136, 138, 140, 142, 146, 148, 150, 152, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 196, 198, 200, 202, 204, 206, 208, 212, 214, 216, 218, 220, 222, 224, 228, 230, 232, 234, 236, 238, 240, 244, 246, 248, 250, 252, 254, 256, 260, 262, 264, 266, 268, 270, 272, 276, 278, 280, 283, 285, 287, 288, 290, 291, 292, 293, 294, 295, 296, 308, 310, 312, 314, 316, 318, 320, 324, 326, 328, 330, 332, 334, 336, 340, 342, 344, 346, 348, 350, 352, 356, 358, 360, 362, 364, 366, 368, 372, 374, 376, 378, 380, 382, 383, 385, 386, 387, 388, 389, 390, 395, 397, 398, 399, 400, 401, 402, 403, 405, 406, 408, 409, 410, 411, 412, 414, 415, 416, 417, 418, 432, 434, 438, 440, 442, 444, 446, 448, 450, 454, 456, 458, 460, 462, 464, 466, 470, 472, 474, 476, 478, 480, 482, 486, 488, 490, 492, 494, 496, 498, 502, 504, 506, 508, 510, 512, 514, 518, 521, 523, 527, 532, 533, 538, 558, 560, 562, 564, 566, 568, 570, 574, 576, 578, 581, 583, 585, 587, 591, 593, 595, 597 << self accessor :_lexer_trans_keys te :_lexer_trans_keys, :_lexer_trans_keys= lexer_trans_keys = [ 2, 34, 35, 37, 42, 64, 65, 9, 71, 77, 78, 79, 83, 124, , 34, 34, 10, 32, 9, 13, 2, 34, 9, 13, 10, 32, 34, , 10, 32, 34, 9, 13, 10, 4, 9, 13, 10, 32, 9, 13, 2, 9, 13, 10, 13, 10, 95, 9, 65, 84, 85, 82, 69, 95, 8, 68, 95, 37, 32, 10, 10, 3, 32, 64, 9, 10, 9, 10, 2, 64, 11, 12, 10, 32, 64, , 98, 115, 116, 114, 97, 107, 32, 83, 99, 101, 110, 97, 114, 111, 58, 10, 10, 10, 32, 35, 2, 64, 71, 77, 78, 79, 83, , 10, 95, 10, 70, 10, 69, 5, 10, 84, 10, 85, 10, 82, 9, 10, 95, 10, 69, 10, 78, 8, 10, 95, 10, 37, 10, 32, 2, 34, 35, 37, 42, 64, 65, 9, 71, 77, 78, 79, 83, 124, , 97, 107, 103, 114, 117, 110, 58, 10, 10, 10, 32, 35, 37, 4, 65, 71, 77, 78, 79, 83, , 10, 95, 10, 70, 10, 69, 5, 10, 84, 10, 85, 10, 82, 9, 10, 95, 10, 69, 10, 78, 8, 10, 95, 10, 37, 10, 32, 8, 10, 115, 10, 116, 10, 114, 7, 10, 107, 10, 116, 10, 32, 3, 10, 99, 10, 101, 10, 110, 7, 10, 114, 10, 105, 10, 111, 8, 10, 105, 10, 118, 10, 101, 16, 10, 101, 10, 110, -61, 10, 10, 10, 114, 10, 99, 10, 104, 10, 99, -91, 10, 103, 120, 101, 115, 107, 97, 112, 58, 10, 10, 2, 35, 37, 64, 65, 66, 83, , 10, 95, 10, 70, 10, 69, 5, 10, 84, 10, 85, 10, 82, 9, 10, 95, 10, 69, 10, 78, 8, 10, 95, 10, 37, 10, 98, 15, 10, 116, 10, 114, 10, 97, 07, 10, 116, 10, 32, 10, 83, 9, 10, 101, 10, 110, 10, 97, 14, 10, 105, 10, 111, 10, 58, 7, 10, 107, 10, 103, 10, 114, 17, 10, 110, 10, 100, 101, 109, 101, 108, 58, 10, 10, 10, 32, 9, 13, 105, 118, 101, 116, 101, -61, -92, 114, 99, 104, -61, 99, 101, 110, 97, 114, 105, 111, 58, 0, 10, 32, 35, 37, 42, 64, 1, 77, 78, 79, 83, 9, 13, 5, 10, 70, 10, 69, 10, 65, 4, 10, 85, 10, 82, 10, 69, 5, 10, 69, 10, 78, 10, 68, 5, 10, 37, 10, 32, 10, 98, 15, 10, 116, 10, 114, 10, 97, 07, 10, 116, 10, 32, 10, 83, 9, 10, 101, 10, 110, 10, 97, 14, 10, 105, 10, 111, 10, 58, 05, 10, 118, 10, 101, 10, 116, 01, 10, 110, -61, 10, -92, 10, 14, 10, 99, 10, 104, -61, 10, 91, 10, 32, 124, 9, 13, 10, 24, 9, 13, 124, 10, 32, 124, , 10, 32, 34, 35, 37, 42, 5, 66, 69, 71, 77, 78, 79, 24, 9, 13, 10, 105, 10, 118, 01, 10, 116, 10, 101, 10, 110, 10, -92, 10, 10, 114, 10, 99, 04, -61, 10, 99, -91, 10, 10, 10, 110, 10, 97, 10, 114, 10, 10, 111, 10, 58, 0 << self accessor :_lexer_single_lengths te :_lexer_single_lengths, :_lexer_single_lengths= lexer_single_lengths = [ , 1, 1, 2, 3, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 1, 1, 1, 1, 1, 1, 1, 1, 12, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 8, 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, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 12, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, 3, 16, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 0 << self accessor :_lexer_range_lengths te :_lexer_range_lengths, :_lexer_range_lengths= lexer_range_lengths = [ 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 1, 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, 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, 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, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 << self accessor :_lexer_index_offsets te :_lexer_index_offsets, :_lexer_index_offsets= lexer_index_offsets = [ 18, 20, 22, 26, 31, 36, 6, 50, 54, 57, 59, 61, 63, 7, 69, 71, 73, 75, 77, 79, 3, 85, 87, 89, 91, 94, 99, 111, 113, 115, 117, 119, 121, 123, 127, 129, 131, 133, 135, 137, 139, 143, 145, 147, 149, 162, 165, 168, 174, 177, 180, 183, 186, 189, 192, 198, 201, 204, 207, 225, 227, 229, 233, 235, 237, 239, 241, 243, 245, 262, 265, 268, 271, 274, 277, 280, 286, 289, 292, 295, 298, 301, 304, 310, 313, 316, 319, 322, 325, 328, 334, 337, 340, 343, 346, 349, 352, 358, 361, 364, 367, 370, 373, 376, 382, 385, 388, 392, 395, 398, 400, 404, 406, 408, 410, 412, 414, 416, 429, 432, 435, 438, 441, 444, 447, 453, 456, 459, 462, 465, 468, 471, 477, 480, 483, 486, 489, 492, 495, 501, 504, 507, 510, 513, 516, 519, 525, 528, 531, 534, 537, 540, 542, 546, 548, 550, 552, 554, 556, 561, 565, 567, 569, 571, 573, 575, 577, 581, 583, 586, 588, 590, 592, 594, 598, 600, 602, 604, 606, 620, 623, 629, 632, 635, 638, 641, 644, 647, 653, 656, 659, 662, 665, 668, 671, 677, 680, 683, 686, 689, 692, 695, 701, 704, 707, 710, 713, 716, 719, 725, 728, 731, 734, 737, 740, 743, 749, 753, 756, 760, 765, 767, 772, 793, 796, 799, 802, 805, 808, 811, 817, 820, 823, 827, 830, 833, 836, 842, 845, 848, 851 << self accessor :_lexer_trans_targs te :_lexer_trans_targs, :_lexer_trans_targs= lexer_trans_targs = [ 2, 11, 13, 27, 30, 33, 25, 183, 187, 189, 192, 194, 251, 3, 0, 4, 0, 5, 4, 6, 6, 7, 6, 6, 6, 6, 6, 6, 6, 8, 6, 6, 9, 6, 6, 1, 10, , 1, 10, 10, 0, 1, 12, , 0, 14, 0, 15, 0, 16, , 0, 18, 0, 19, 0, 20, , 0, 22, 0, 23, 0, 24, , 0, 26, 0, 276, 0, 28, 29, 1, 12, 29, 0, 0, 31, 32, 1, 32, 32, 30, 1, 1, 32, 30, 32, 0, 34, , 0, 36, 0, 37, 0, 38, , 0, 40, 0, 41, 0, 42, , 0, 44, 0, 45, 0, 46, , 0, 48, 0, 49, 0, 50, , 51, 52, 51, 52, 52, 1, 7, 1, 256, 260, 262, 265, 267, 1, 52, 54, 51, 52, 55, 51, 6, 51, 52, 57, 51, 52, 58, 2, 59, 51, 52, 60, 51, 52, 1, 52, 62, 51, 52, 63, 51, 4, 51, 52, 65, 51, 52, 66, 2, 1, 51, 52, 68, 51, 1, 11, 13, 27, 30, 33, 69, 183, 187, 189, 192, 194, 251, 1, , 0, 71, 0, 72, 0, 73, , 0, 75, 0, 76, 0, 77, , 78, 79, 78, 79, 79, 1, 4, 1, 95, 112, 116, 118, 121, 79, 78, 79, 81, 78, 79, 82, 9, 83, 78, 79, 84, 78, 79, 8, 79, 86, 78, 79, 87, 78, 8, 78, 79, 89, 78, 79, 90, 9, 91, 78, 79, 92, 78, 79, 8, 79, 1, 78, 79, 68, 78, 6, 78, 79, 97, 78, 79, 98, 9, 99, 78, 79, 100, 78, 79, 78, 79, 102, 78, 79, 103, 78, 04, 78, 79, 105, 78, 79, 106, 9, 107, 78, 79, 108, 78, 79, 78, 79, 110, 78, 79, 111, 78, 8, 78, 79, 113, 78, 79, 114, 9, 115, 78, 79, 94, 78, 79, 78, 79, 94, 78, 119, 79, 78, 79, 78, 79, 94, 78, 79, 122, 9, 94, 78, 124, 79, 105, 78, 9, 78, 126, 174, 0, 127, 0, 0, 129, 0, 130, 0, 131, 0, 0, 133, 0, 135, 134, 135, 134, 135, 1, 136, 1, 150, 167, 159, 134, 135, 137, 134, 135, 138, 134, 139, 134, 135, 140, 134, 135, 141, 135, 142, 134, 135, 143, 134, 135, 134, 135, 145, 134, 135, 146, 134, 147, 134, 135, 148, 134, 135, 149, 135, 1, 134, 135, 151, 134, 135, 134, 135, 153, 134, 135, 154, 134, 155, 134, 135, 156, 134, 135, 157, 135, 158, 134, 135, 159, 134, 135, 134, 135, 161, 134, 135, 162, 134, 163, 134, 135, 164, 134, 135, 165, 135, 166, 134, 135, 68, 134, 135, 134, 135, 169, 134, 135, 170, 134, 171, 134, 135, 172, 134, 135, 173, 135, 166, 134, 175, 0, 176, 0, 0, 178, 0, 179, 0, 180, 0, 181, 182, 181, 182, 182, 1, 182, 184, 0, 185, 0, 186, 0, 27, 8, 0, 27, 0, 190, 0, 191, , 0, 193, 0, 27, 0, 195, 0, 27, 0, 197, 0, 198, 0, 0, 200, 0, 201, 0, 202, 0, 0, 205, 204, 205, 204, 205, 205, 6, 220, 1, 221, 238, 242, 244, 249, 205, 204, 205, 207, 204, 205, 204, 205, 209, 204, 205, 210, 204, 211, 204, 205, 212, 204, 205, 213, 205, 214, 204, 205, 215, 204, 205, 204, 205, 217, 204, 205, 218, 204, 219, 204, 205, 1, 204, 205, 68, 205, 222, 204, 205, 223, 204, 205, 204, 205, 225, 204, 205, 226, 204, 227, 204, 205, 228, 204, 205, 229, 205, 230, 204, 205, 231, 204, 205, 204, 205, 233, 204, 205, 234, 204, 235, 204, 205, 236, 204, 205, 237, 205, 68, 204, 205, 239, 204, 205, 204, 205, 241, 204, 205, 220, 204, 243, 204, 205, 220, 204, 245, 205, 246, 205, 204, 205, 220, 204, 205, 204, 205, 220, 204, 250, 205, 231, 220, 205, 204, 251, 252, 251, 0, 254, 252, 254, 253, 252, 253, 255, 252, 254, 253, 255, 255, 2, 11, 7, 30, 33, 69, 125, 183, 187, 192, 194, 251, 255, 0, 52, 257, 2, 258, 51, 52, 259, 51, 52, 1, 52, 261, 51, 52, 67, 51, 52, 51, 264, 52, 51, 52, 67, 2, 266, 51, 52, 67, 51, 268, 69, 51, 67, 52, 51, 52, 270, 2, 271, 51, 52, 272, 51, 52, 51, 52, 274, 51, 52, 275, 51, 8, 51, 0, 0 << self accessor :_lexer_trans_actions te :_lexer_trans_actions, :_lexer_trans_actions= lexer_trans_actions = [ , 3, 1, 0, 23, 1, 23, 3, 23, 23, 23, 23, 23, 29, , 0, 37, 0, 37, 45, 0, , 117, 39, 39, 39, 5, 109, 7, 27, 0, 109, 27, 27, 27, 9, 27, 0, 27, 0, 93, 7, , 45, 0, 0, 37, 101, 19, , 37, 0, 37, 0, 37, 0, , 37, 0, 37, 0, 37, 0, , 37, 0, 37, 0, 37, 0, , 37, 0, 37, 0, 37, 0, 7, 48, 97, 17, 0, 37, 37, 7, 0, 21, 105, 21, 21, 42, , 45, 0, 1, 0, 37, 0, , 37, 0, 37, 0, 37, 0, , 37, 0, 37, 0, 37, 0, , 37, 0, 37, 0, 37, 0, , 37, 0, 37, 0, 37, 0, 22, 48, 45, 0, 45, 0, 69, 5, 69, 75, 75, 75, 75, 75, 45, 0, 0, 45, 0, 0, , 0, 45, 0, 0, 45, 0, , 0, 0, 45, 0, 0, 45, 45, 0, 0, 45, 0, 0, , 0, 45, 0, 0, 45, 0, , 15, 0, 45, 15, 0, 113, 1, 48, 25, 54, 48, 54, 54, 4, 54, 54, 54, 54, 57, 25, , 37, 0, 37, 0, 37, 0, , 37, 0, 37, 0, 37, 0, 22, 48, 45, 0, 45, 0, 63, 5, 63, 75, 75, 75, 75, 75, , 0, 45, 0, 0, 45, 0, , 0, 0, 45, 0, 0, 45, 45, 0, 0, 45, 0, 0, , 0, 45, 0, 0, 45, 0, , 0, 0, 45, 0, 0, 45, 45, 11, 0, 45, 11, 0, , 0, 45, 0, 0, 45, 0, , 0, 0, 45, 0, 0, 45, 45, 0, 0, 45, 0, 0, , 0, 45, 0, 0, 45, 0, , 0, 0, 45, 0, 0, 45, 45, 0, 0, 45, 0, 0, 1, 0, 45, 0, 0, 45, 0, , 0, 0, 45, 0, 0, 45, 45, 0, 0, 0, 45, 0, , 0, 45, 0, 0, 45, 0, , 0, 0, 0, 45, 0, 0, , 0, 0, 0, 37, 0, 37, , 0, 37, 0, 37, 0, 37, , 0, 37, 122, 48, 45, 0, , 60, 27, 60, 75, 75, 75, 45, 0, 0, 45, 0, 0, , 0, 45, 0, 0, 45, 0, , 0, 0, 45, 0, 0, 45, 45, 0, 0, 45, 0, 0, , 0, 45, 0, 0, 45, 0, , 9, 0, 45, 0, 0, 45, 45, 0, 0, 45, 0, 0, , 0, 45, 0, 0, 45, 0, , 0, 0, 45, 0, 0, 45, 45, 0, 0, 45, 0, 0, , 0, 45, 0, 0, 45, 0, , 0, 0, 45, 9, 0, 45, 45, 0, 0, 45, 0, 0, , 0, 45, 0, 0, 45, 0, , 0, 0, 0, 37, 0, 37, , 0, 37, 0, 37, 0, 37, 48, 45, 0, 45, 0, 72, 0, 37, 0, 37, 0, 37, 0, , 37, 0, 37, 0, 37, 0, , 37, 0, 37, 0, 37, 0, , 0, 37, 0, 37, 0, 37, , 0, 37, 0, 37, 0, 37, , 122, 48, 45, 0, 45, 0, 7, 75, 66, 75, 75, 75, 75, 5, 0, 0, 45, 0, 0, 45, 45, 0, 0, 45, 0, 0, , 0, 45, 0, 0, 45, 0, , 0, 0, 45, 0, 0, 45, 45, 0, 0, 45, 0, 0, , 0, 45, 13, 0, 45, 13, , 0, 0, 45, 0, 0, 45, 45, 0, 0, 45, 0, 0, , 0, 45, 0, 0, 45, 0, , 0, 0, 45, 0, 0, 45, 45, 0, 0, 45, 0, 0, , 0, 45, 0, 0, 45, 0, , 13, 0, 45, 0, 0, 45, 45, 0, 0, 45, 0, 0, , 0, 45, 0, 0, 0, 45, 45, 0, 45, 0, 0, 45, 45, 0, 0, 0, 45, 0, 45, 0, 0, 0, 0, 37, 1, 78, 31, 31, 33, 0, 45, , 0, 0, 45, 0, 84, 81, 7, 81, 87, 87, 87, 87, 87, 7, 87, 90, 0, 37, 45, 0, , 0, 0, 45, 0, 0, 45, 45, 0, 0, 45, 0, 0, , 0, 0, 45, 0, 45, 0, , 0, 0, 45, 0, 0, 0, , 0, 0, 45, 0, 45, 0, , 0, 0, 45, 0, 0, 45, 45, 0, 0, 45, 0, 0, 5, 0, 0, 0 << self accessor :_lexer_eof_actions te :_lexer_eof_actions, :_lexer_eof_actions= lexer_eof_actions = [ , 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37, 37, 37, 37, 7, 37, 37, 37 << self accessor :lexer_start exer_start = 1; << self accessor :lexer_first_final exer_first_final = 276; << self accessor :lexer_error exer_error = 0; << self accessor :lexer_en_main exer_en_main = 1; 130 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" end
def multiline_strip(text)
def multiline_strip(text) crlf_count = text.scan(CRLF_RE).size lf_count = text.scan(LF_RE).size eol = crlf_count > lf_count ? CRLF : LF text.split(/\r?\n/).map{|s| s.strip}.join(eol).strip end
def scan(data)
def scan(data) data = (data + "\n%_FEATURE_END_%").unpack("c*") # Explicit EOF simplifies things considerably eof = pe = data.length @line_number = 1 @last_newline = 0 590 "lib/gherkin/rb_lexer/sv.rb" 0 = data.length lexer_start 140 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" 599 "lib/gherkin/rb_lexer/sv.rb" , _trans, _keys, _acts, _nacts = nil _level = 0 me = 10 trans = 15 n = 20 _eof = 30 = 40 true ger_goto = false oto_level <= 0 == pe o_level = _test_eof == 0 o_level = _out oto_level <= _resume = _lexer_key_offsets[cs] s = _lexer_index_offsets[cs] = _lexer_single_lengths[cs] k_match = false _klen > 0 _lower = _keys _upper = _keys + _klen - 1 loop do break if _upper < _lower _mid = _lower + ( (_upper - _lower) >> 1 ) if data[p] < _lexer_trans_keys[_mid] _upper = _mid - 1 elsif data[p] > _lexer_trans_keys[_mid] _lower = _mid + 1 else _trans += (_mid - _keys) _break_match = true break end end # loop break if _break_match _keys += _klen _trans += _klen en = _lexer_range_lengths[cs] _klen > 0 _lower = _keys _upper = _keys + (_klen << 1) - 2 loop do break if _upper < _lower _mid = _lower + (((_upper-_lower) >> 1) & ~1) if data[p] < _lexer_trans_keys[_mid] _upper = _mid - 2 elsif data[p] > _lexer_trans_keys[_mid+1] _lower = _mid + 2 else _trans += ((_mid - _keys) >> 1) _break_match = true break end end # loop break if _break_match _trans += _klen hile false _lexer_trans_targs[_trans] exer_trans_actions[_trans] != 0 s = _lexer_trans_actions[_trans] ts = _lexer_actions[_acts] s += 1 e _nacts > 0 cts -= 1 ts += 1 e _lexer_actions[_acts - 1] then 9 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n @content_start = p @current_line = @line_number end 9 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" then 14 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n @current_line = @line_number @start_col = p - @last_newline end 14 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" then 19 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n @content_start = p end 19 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" then 23 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n con = unindent(@start_col, data[@content_start...@next_keyword_start-1].utf8_pack("c*").sub(/(\r?\n)?( )*\Z/, '').gsub(/\\"\\"\\"/, '"""')) @listener.py_string(con, @current_line) end 23 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" then 28 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n store_keyword_content(:feature, data, p, eof) { |con| multiline_strip(con) } p = @next_keyword_start - 1 if @next_keyword_start @next_keyword_start = nil end 28 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" then 34 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n store_keyword_content(:background, data, p, eof) { |con| multiline_strip(con) } p = @next_keyword_start - 1 if @next_keyword_start @next_keyword_start = nil end 34 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" then 40 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n store_keyword_content(:scenario, data, p, eof) { |con| multiline_strip(con) } p = @next_keyword_start - 1 if @next_keyword_start @next_keyword_start = nil end 40 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" then 46 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n store_keyword_content(:scenario_outline, data, p, eof) { |con| multiline_strip(con) } p = @next_keyword_start - 1 if @next_keyword_start @next_keyword_start = nil end 46 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" then 52 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n store_keyword_content(:examples, data, p, eof) { |con| multiline_strip(con) } p = @next_keyword_start - 1 if @next_keyword_start @next_keyword_start = nil end 52 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" then 58 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n con = data[@content_start...p].utf8_pack("c*").strip @listener.step(@keyword, con, @current_line) end 58 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" 0 then 63 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n con = data[@content_start...p].utf8_pack("c*").strip @listener.comment(con, @line_number) @keyword_start = nil end 63 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" 1 then 69 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n con = data[@content_start...p].utf8_pack("c*").strip @listener.tag(con, @current_line) @keyword_start = nil end 69 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" 2 then 75 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n @line_number += 1 end 75 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" 3 then 79 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n @last_newline = p + 1 end 79 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" 4 then 83 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n @keyword_start ||= p end 83 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" 5 then 87 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n @keyword = data[@keyword_start...p].utf8_pack("c*").sub(/:$/,'') @keyword_start = nil end 87 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" 6 then 92 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n @next_keyword_start = p end 92 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" 7 then 96 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n p = p - 1 current_row = [] @current_line = @line_number end 96 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" 8 then 102 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n @content_start = p end 102 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" 9 then 106 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n con = data[@content_start...p].utf8_pack("c*").strip current_row << con end 106 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" 0 then 111 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n @listener.row(current_row, @current_line) end 111 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" 1 then 115 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n if cs < lexer_first_final content = current_line_content(data, p) raise LexingError.new("Lexing error on line %d: '%s'." % [@line_number, content]) else @listener.eof end end 115 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" 860 "lib/gherkin/rb_lexer/sv.rb" # action switch rigger_goto oto_level <= _again == 0 o_level = _out 1 != pe o_level = _resume oto_level <= _test_eof == eof s = _lexer_eof_actions[cs] ts = _lexer_actions[__acts] s += 1 __nacts > 0 cts -= 1 ts += 1 _lexer_actions[__acts - 1] 1 then 115 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" n if cs < lexer_first_final content = current_line_content(data, p) raise LexingError.new("Lexing error on line %d: '%s'." % [@line_number, content]) else @listener.eof end end 115 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" 900 "lib/gherkin/rb_lexer/sv.rb" # eof action switch rigger_goto oto_level <= _out k 141 "/Users/aslakhellesoy/scm/gherkin/tasks/../ragel/i18n/sv.rb.rl" end
def store_keyword_content(event, data, p, eof)
def store_keyword_content(event, data, p, eof) end_point = (!@next_keyword_start or (p == eof)) ? p : @next_keyword_start con = yield data[@content_start...end_point].utf8_pack("c*") @listener.send(event, @keyword, con, @current_line) end
def unindent(startcol, text)
def unindent(startcol, text) text.gsub(/^ {0,#{startcol}}/, "") end