gherkin 2.12.2 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -15
- data/CONTRIBUTING.md +23 -0
- data/Gemfile +0 -3
- data/LICENSE +18 -17
- data/Makefile +65 -0
- data/README.md +9 -268
- data/Rakefile +17 -19
- data/bin/gherkin-generate-ast +21 -0
- data/bin/gherkin-generate-pickles +25 -0
- data/bin/gherkin-generate-tokens +12 -0
- data/gherkin-ruby.razor +218 -0
- data/gherkin.gemspec +22 -76
- data/lib/gherkin/ast_builder.rb +243 -0
- data/lib/gherkin/ast_node.rb +30 -0
- data/lib/gherkin/dialect.rb +58 -0
- data/lib/gherkin/errors.rb +45 -0
- data/lib/gherkin/gherkin-languages.json +2968 -0
- data/lib/gherkin/gherkin_line.rb +95 -0
- data/lib/gherkin/parser.rb +1910 -0
- data/lib/gherkin/pickles/compiler.rb +164 -0
- data/lib/gherkin/token.rb +18 -0
- data/lib/gherkin/token_formatter_builder.rb +39 -0
- data/lib/gherkin/token_matcher.rb +169 -0
- data/lib/gherkin/token_scanner.rb +40 -0
- data/spec/capture_warnings.rb +68 -0
- data/spec/coverage.rb +10 -0
- data/spec/gherkin/parser_spec.rb +146 -0
- metadata +60 -567
- data/.gitattributes +0 -2
- data/.mailmap +0 -2
- data/.rbenv-gemsets +0 -1
- data/.rspec +0 -1
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/.yardopts +0 -5
- data/History.md +0 -881
- data/build_native_gems.sh +0 -7
- data/cucumber.yml +0 -5
- data/examples/parse_and_output_json.rb +0 -19
- data/ext/gherkin_lexer_ar/extconf.rb +0 -6
- data/ext/gherkin_lexer_ar/gherkin_lexer_ar.c +0 -1432
- data/ext/gherkin_lexer_bg/extconf.rb +0 -6
- data/ext/gherkin_lexer_bg/gherkin_lexer_bg.c +0 -1655
- data/ext/gherkin_lexer_bm/extconf.rb +0 -6
- data/ext/gherkin_lexer_bm/gherkin_lexer_bm.c +0 -1516
- data/ext/gherkin_lexer_ca/extconf.rb +0 -6
- data/ext/gherkin_lexer_ca/gherkin_lexer_ca.c +0 -1581
- data/ext/gherkin_lexer_cs/extconf.rb +0 -6
- data/ext/gherkin_lexer_cs/gherkin_lexer_cs.c +0 -1515
- data/ext/gherkin_lexer_cy_gb/extconf.rb +0 -6
- data/ext/gherkin_lexer_cy_gb/gherkin_lexer_cy_gb.c +0 -1282
- data/ext/gherkin_lexer_da/extconf.rb +0 -6
- data/ext/gherkin_lexer_da/gherkin_lexer_da.c +0 -1298
- data/ext/gherkin_lexer_de/extconf.rb +0 -6
- data/ext/gherkin_lexer_de/gherkin_lexer_de.c +0 -1425
- data/ext/gherkin_lexer_el/extconf.rb +0 -6
- data/ext/gherkin_lexer_el/gherkin_lexer_el.c +0 -1919
- data/ext/gherkin_lexer_en/extconf.rb +0 -6
- data/ext/gherkin_lexer_en/gherkin_lexer_en.c +0 -1418
- data/ext/gherkin_lexer_en_au/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_au/gherkin_lexer_en_au.c +0 -1765
- data/ext/gherkin_lexer_en_lol/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_lol/gherkin_lexer_en_lol.c +0 -1177
- data/ext/gherkin_lexer_en_old/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_old/gherkin_lexer_en_old.c +0 -1309
- data/ext/gherkin_lexer_en_pirate/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_pirate/gherkin_lexer_en_pirate.c +0 -1471
- data/ext/gherkin_lexer_en_scouse/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_scouse/gherkin_lexer_en_scouse.c +0 -1634
- data/ext/gherkin_lexer_en_tx/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_tx/gherkin_lexer_en_tx.c +0 -1265
- data/ext/gherkin_lexer_eo/extconf.rb +0 -6
- data/ext/gherkin_lexer_eo/gherkin_lexer_eo.c +0 -1241
- data/ext/gherkin_lexer_es/extconf.rb +0 -6
- data/ext/gherkin_lexer_es/gherkin_lexer_es.c +0 -1399
- data/ext/gherkin_lexer_et/extconf.rb +0 -6
- data/ext/gherkin_lexer_et/gherkin_lexer_et.c +0 -1236
- data/ext/gherkin_lexer_fa/extconf.rb +0 -6
- data/ext/gherkin_lexer_fa/gherkin_lexer_fa.c +0 -1475
- data/ext/gherkin_lexer_fi/extconf.rb +0 -6
- data/ext/gherkin_lexer_fi/gherkin_lexer_fi.c +0 -1215
- data/ext/gherkin_lexer_fr/extconf.rb +0 -6
- data/ext/gherkin_lexer_fr/gherkin_lexer_fr.c +0 -1493
- data/ext/gherkin_lexer_gl/extconf.rb +0 -6
- data/ext/gherkin_lexer_gl/gherkin_lexer_gl.c +0 -1374
- data/ext/gherkin_lexer_he/extconf.rb +0 -6
- data/ext/gherkin_lexer_he/gherkin_lexer_he.c +0 -1374
- data/ext/gherkin_lexer_hi/extconf.rb +0 -6
- data/ext/gherkin_lexer_hi/gherkin_lexer_hi.c +0 -1848
- data/ext/gherkin_lexer_hr/extconf.rb +0 -6
- data/ext/gherkin_lexer_hr/gherkin_lexer_hr.c +0 -1323
- data/ext/gherkin_lexer_hu/extconf.rb +0 -6
- data/ext/gherkin_lexer_hu/gherkin_lexer_hu.c +0 -1376
- data/ext/gherkin_lexer_id/extconf.rb +0 -6
- data/ext/gherkin_lexer_id/gherkin_lexer_id.c +0 -1208
- data/ext/gherkin_lexer_is/extconf.rb +0 -6
- data/ext/gherkin_lexer_is/gherkin_lexer_is.c +0 -1376
- data/ext/gherkin_lexer_it/extconf.rb +0 -6
- data/ext/gherkin_lexer_it/gherkin_lexer_it.c +0 -1340
- data/ext/gherkin_lexer_ja/extconf.rb +0 -6
- data/ext/gherkin_lexer_ja/gherkin_lexer_ja.c +0 -1699
- data/ext/gherkin_lexer_kn/extconf.rb +0 -6
- data/ext/gherkin_lexer_kn/gherkin_lexer_kn.c +0 -1965
- data/ext/gherkin_lexer_ko/extconf.rb +0 -6
- data/ext/gherkin_lexer_ko/gherkin_lexer_ko.c +0 -1360
- data/ext/gherkin_lexer_lt/extconf.rb +0 -6
- data/ext/gherkin_lexer_lt/gherkin_lexer_lt.c +0 -1296
- data/ext/gherkin_lexer_lu/extconf.rb +0 -6
- data/ext/gherkin_lexer_lu/gherkin_lexer_lu.c +0 -1389
- data/ext/gherkin_lexer_lv/extconf.rb +0 -6
- data/ext/gherkin_lexer_lv/gherkin_lexer_lv.c +0 -1425
- data/ext/gherkin_lexer_nl/extconf.rb +0 -6
- data/ext/gherkin_lexer_nl/gherkin_lexer_nl.c +0 -1368
- data/ext/gherkin_lexer_no/extconf.rb +0 -6
- data/ext/gherkin_lexer_no/gherkin_lexer_no.c +0 -1311
- data/ext/gherkin_lexer_pa/extconf.rb +0 -6
- data/ext/gherkin_lexer_pa/gherkin_lexer_pa.c +0 -2160
- data/ext/gherkin_lexer_pl/extconf.rb +0 -6
- data/ext/gherkin_lexer_pl/gherkin_lexer_pl.c +0 -1738
- data/ext/gherkin_lexer_pt/extconf.rb +0 -6
- data/ext/gherkin_lexer_pt/gherkin_lexer_pt.c +0 -1711
- data/ext/gherkin_lexer_ro/extconf.rb +0 -6
- data/ext/gherkin_lexer_ro/gherkin_lexer_ro.c +0 -1427
- data/ext/gherkin_lexer_ru/extconf.rb +0 -6
- data/ext/gherkin_lexer_ru/gherkin_lexer_ru.c +0 -2071
- data/ext/gherkin_lexer_sk/extconf.rb +0 -6
- data/ext/gherkin_lexer_sk/gherkin_lexer_sk.c +0 -1739
- data/ext/gherkin_lexer_sr_cyrl/extconf.rb +0 -6
- data/ext/gherkin_lexer_sr_cyrl/gherkin_lexer_sr_cyrl.c +0 -2112
- data/ext/gherkin_lexer_sr_latn/extconf.rb +0 -6
- data/ext/gherkin_lexer_sr_latn/gherkin_lexer_sr_latn.c +0 -1567
- data/ext/gherkin_lexer_sv/extconf.rb +0 -6
- data/ext/gherkin_lexer_sv/gherkin_lexer_sv.c +0 -1324
- data/ext/gherkin_lexer_th/extconf.rb +0 -6
- data/ext/gherkin_lexer_th/gherkin_lexer_th.c +0 -2840
- data/ext/gherkin_lexer_tl/extconf.rb +0 -6
- data/ext/gherkin_lexer_tl/gherkin_lexer_tl.c +0 -2021
- data/ext/gherkin_lexer_tr/extconf.rb +0 -6
- data/ext/gherkin_lexer_tr/gherkin_lexer_tr.c +0 -1347
- data/ext/gherkin_lexer_tt/extconf.rb +0 -6
- data/ext/gherkin_lexer_tt/gherkin_lexer_tt.c +0 -1936
- data/ext/gherkin_lexer_uk/extconf.rb +0 -6
- data/ext/gherkin_lexer_uk/gherkin_lexer_uk.c +0 -1941
- data/ext/gherkin_lexer_uz/extconf.rb +0 -6
- data/ext/gherkin_lexer_uz/gherkin_lexer_uz.c +0 -1651
- data/ext/gherkin_lexer_vi/extconf.rb +0 -6
- data/ext/gherkin_lexer_vi/gherkin_lexer_vi.c +0 -1458
- data/ext/gherkin_lexer_zh_cn/extconf.rb +0 -6
- data/ext/gherkin_lexer_zh_cn/gherkin_lexer_zh_cn.c +0 -1314
- data/ext/gherkin_lexer_zh_tw/extconf.rb +0 -6
- data/ext/gherkin_lexer_zh_tw/gherkin_lexer_zh_tw.c +0 -1307
- data/features/.cucumber/stepdefs.json +0 -244
- data/features/escaped_pipes.feature +0 -8
- data/features/feature_parser.feature +0 -237
- data/features/json_formatter.feature +0 -498
- data/features/json_parser.feature +0 -331
- data/features/native_lexer.feature +0 -19
- data/features/parser_with_native_lexer.feature +0 -205
- data/features/pretty_formatter.feature +0 -17
- data/features/step_definitions/eyeball_steps.rb +0 -3
- data/features/step_definitions/gherkin_steps.rb +0 -29
- data/features/step_definitions/json_formatter_steps.rb +0 -30
- data/features/step_definitions/json_parser_steps.rb +0 -21
- data/features/step_definitions/pretty_formatter_steps.rb +0 -85
- data/features/steps_parser.feature +0 -46
- data/features/support/env.rb +0 -41
- data/install_mingw_os_x.sh +0 -5
- data/js/.npmignore +0 -1
- data/js/lib/gherkin/lexer/.npmignore +0 -0
- data/lib/gherkin.rb +0 -2
- data/lib/gherkin/README.md +0 -7
- data/lib/gherkin/c_lexer.rb +0 -17
- data/lib/gherkin/formatter/ansi_escapes.rb +0 -97
- data/lib/gherkin/formatter/argument.rb +0 -16
- data/lib/gherkin/formatter/escaping.rb +0 -15
- data/lib/gherkin/formatter/filter_formatter.rb +0 -150
- data/lib/gherkin/formatter/hashable.rb +0 -25
- data/lib/gherkin/formatter/json_formatter.rb +0 -133
- data/lib/gherkin/formatter/line_filter.rb +0 -26
- data/lib/gherkin/formatter/model.rb +0 -281
- data/lib/gherkin/formatter/pretty_formatter.rb +0 -245
- data/lib/gherkin/formatter/regexp_filter.rb +0 -21
- data/lib/gherkin/formatter/step_printer.rb +0 -21
- data/lib/gherkin/formatter/tag_count_formatter.rb +0 -47
- data/lib/gherkin/formatter/tag_filter.rb +0 -19
- data/lib/gherkin/i18n.json +0 -786
- data/lib/gherkin/i18n.rb +0 -176
- data/lib/gherkin/json_parser.rb +0 -177
- data/lib/gherkin/lexer/ar.rb +0 -1170
- data/lib/gherkin/lexer/bg.rb +0 -1382
- data/lib/gherkin/lexer/bm.rb +0 -1250
- data/lib/gherkin/lexer/ca.rb +0 -1310
- data/lib/gherkin/lexer/cs.rb +0 -1246
- data/lib/gherkin/lexer/cy_gb.rb +0 -1032
- data/lib/gherkin/lexer/da.rb +0 -1048
- data/lib/gherkin/lexer/de.rb +0 -1166
- data/lib/gherkin/lexer/el.rb +0 -1628
- data/lib/gherkin/lexer/en.rb +0 -1156
- data/lib/gherkin/lexer/en_au.rb +0 -1486
- data/lib/gherkin/lexer/en_lol.rb +0 -934
- data/lib/gherkin/lexer/en_old.rb +0 -1037
- data/lib/gherkin/lexer/en_pirate.rb +0 -1210
- data/lib/gherkin/lexer/en_scouse.rb +0 -1362
- data/lib/gherkin/lexer/en_tx.rb +0 -1016
- data/lib/gherkin/lexer/encoding.rb +0 -41
- data/lib/gherkin/lexer/eo.rb +0 -995
- data/lib/gherkin/lexer/es.rb +0 -1140
- data/lib/gherkin/lexer/et.rb +0 -990
- data/lib/gherkin/lexer/fa.rb +0 -1214
- data/lib/gherkin/lexer/fi.rb +0 -969
- data/lib/gherkin/lexer/fr.rb +0 -1228
- data/lib/gherkin/lexer/gl.rb +0 -1117
- data/lib/gherkin/lexer/he.rb +0 -1118
- data/lib/gherkin/lexer/hi.rb +0 -1559
- data/lib/gherkin/lexer/hr.rb +0 -1066
- data/lib/gherkin/lexer/hu.rb +0 -1118
- data/lib/gherkin/lexer/i18n_lexer.rb +0 -48
- data/lib/gherkin/lexer/id.rb +0 -963
- data/lib/gherkin/lexer/is.rb +0 -1120
- data/lib/gherkin/lexer/it.rb +0 -1086
- data/lib/gherkin/lexer/ja.rb +0 -1418
- data/lib/gherkin/lexer/kn.rb +0 -1672
- data/lib/gherkin/lexer/ko.rb +0 -1102
- data/lib/gherkin/lexer/lt.rb +0 -1045
- data/lib/gherkin/lexer/lu.rb +0 -1132
- data/lib/gherkin/lexer/lv.rb +0 -1166
- data/lib/gherkin/lexer/nl.rb +0 -1115
- data/lib/gherkin/lexer/no.rb +0 -1060
- data/lib/gherkin/lexer/pa.rb +0 -1852
- data/lib/gherkin/lexer/pl.rb +0 -1457
- data/lib/gherkin/lexer/pt.rb +0 -1430
- data/lib/gherkin/lexer/ro.rb +0 -1164
- data/lib/gherkin/lexer/ru.rb +0 -1766
- data/lib/gherkin/lexer/sk.rb +0 -1452
- data/lib/gherkin/lexer/sr_cyrl.rb +0 -1803
- data/lib/gherkin/lexer/sr_latn.rb +0 -1294
- data/lib/gherkin/lexer/sv.rb +0 -1070
- data/lib/gherkin/lexer/th.rb +0 -2492
- data/lib/gherkin/lexer/tl.rb +0 -1726
- data/lib/gherkin/lexer/tr.rb +0 -1092
- data/lib/gherkin/lexer/tt.rb +0 -1643
- data/lib/gherkin/lexer/uk.rb +0 -1646
- data/lib/gherkin/lexer/uz.rb +0 -1376
- data/lib/gherkin/lexer/vi.rb +0 -1198
- data/lib/gherkin/lexer/zh_cn.rb +0 -1058
- data/lib/gherkin/lexer/zh_tw.rb +0 -1052
- data/lib/gherkin/listener/event.rb +0 -45
- data/lib/gherkin/listener/formatter_listener.rb +0 -150
- data/lib/gherkin/native.rb +0 -7
- data/lib/gherkin/native/java.rb +0 -72
- data/lib/gherkin/native/null.rb +0 -5
- data/lib/gherkin/native/therubyracer.rb +0 -41
- data/lib/gherkin/parser/meta.txt +0 -5
- data/lib/gherkin/parser/parser.rb +0 -166
- data/lib/gherkin/parser/root.txt +0 -11
- data/lib/gherkin/parser/steps.txt +0 -4
- data/lib/gherkin/platform.rb +0 -13
- data/lib/gherkin/rubify.rb +0 -31
- data/lib/gherkin/tag_expression.rb +0 -63
- data/ragel/lexer.c.rl.erb +0 -454
- data/ragel/lexer.java.rl.erb +0 -219
- data/ragel/lexer.js.rl.erb +0 -322
- data/ragel/lexer.rb.rl.erb +0 -179
- data/ragel/lexer_common.rl.erb +0 -50
- data/spec/gherkin/c_lexer_spec.rb +0 -22
- data/spec/gherkin/fixtures/1.feature +0 -8
- data/spec/gherkin/fixtures/comments_in_table.feature +0 -9
- data/spec/gherkin/fixtures/complex.feature +0 -45
- data/spec/gherkin/fixtures/complex.json +0 -139
- data/spec/gherkin/fixtures/complex_for_filtering.feature +0 -60
- data/spec/gherkin/fixtures/complex_with_tags.feature +0 -61
- data/spec/gherkin/fixtures/dos_line_endings.feature +0 -45
- data/spec/gherkin/fixtures/examples_with_only_header.feature +0 -14
- data/spec/gherkin/fixtures/hantu_pisang.feature +0 -35
- data/spec/gherkin/fixtures/i18n_fr.feature +0 -14
- data/spec/gherkin/fixtures/i18n_fr2.feature +0 -8
- data/spec/gherkin/fixtures/i18n_no.feature +0 -7
- data/spec/gherkin/fixtures/i18n_pt1.feature +0 -44
- data/spec/gherkin/fixtures/i18n_pt2.feature +0 -4
- data/spec/gherkin/fixtures/i18n_pt3.feature +0 -4
- data/spec/gherkin/fixtures/i18n_pt4.feature +0 -4
- data/spec/gherkin/fixtures/i18n_zh-CN.feature +0 -9
- data/spec/gherkin/fixtures/iso-8859-1.feature +0 -6
- data/spec/gherkin/fixtures/issue_145.feature +0 -22
- data/spec/gherkin/fixtures/scenario_outline_with_tags.feature +0 -13
- data/spec/gherkin/fixtures/scenario_without_steps.feature +0 -5
- data/spec/gherkin/fixtures/simple_with_comments.feature +0 -7
- data/spec/gherkin/fixtures/simple_with_tags.feature +0 -11
- data/spec/gherkin/fixtures/with_bom.feature +0 -3
- data/spec/gherkin/fixtures/with_bom_and_language_spec.feature +0 -4
- data/spec/gherkin/formatter/ansi_escapes_spec.rb +0 -32
- data/spec/gherkin/formatter/filter_formatter_spec.rb +0 -204
- data/spec/gherkin/formatter/json_formatter_spec.rb +0 -179
- data/spec/gherkin/formatter/model_spec.rb +0 -28
- data/spec/gherkin/formatter/pretty_formatter_spec.rb +0 -184
- data/spec/gherkin/formatter/spaces.feature +0 -9
- data/spec/gherkin/formatter/step_printer_spec.rb +0 -55
- data/spec/gherkin/formatter/tabs.feature +0 -9
- data/spec/gherkin/formatter/tag_count_formatter_spec.rb +0 -30
- data/spec/gherkin/i18n_spec.rb +0 -256
- data/spec/gherkin/java_lexer_spec.rb +0 -20
- data/spec/gherkin/json_parser_spec.rb +0 -165
- data/spec/gherkin/lexer/i18n_lexer_spec.rb +0 -65
- data/spec/gherkin/native_lexer_spec.rb +0 -29
- data/spec/gherkin/parser/parser_spec.rb +0 -16
- data/spec/gherkin/rubify_spec.rb +0 -23
- data/spec/gherkin/sexp_recorder.rb +0 -59
- data/spec/gherkin/shared/doc_string_group.rb +0 -161
- data/spec/gherkin/shared/encoding_group.rb +0 -48
- data/spec/gherkin/shared/lexer_group.rb +0 -589
- data/spec/gherkin/shared/row_group.rb +0 -123
- data/spec/gherkin/shared/tags_group.rb +0 -52
- data/spec/gherkin/tag_expression_spec.rb +0 -146
- data/spec/spec_helper.rb +0 -94
- data/tasks/apidoc.rake +0 -32
- data/tasks/bench.rake +0 -184
- data/tasks/bench/feature_builder.rb +0 -49
- data/tasks/bench/null_listener.rb +0 -4
- data/tasks/compile.rake +0 -83
- data/tasks/cucumber.rake +0 -23
- data/tasks/gems.rake +0 -46
- data/tasks/ikvm.rake +0 -126
- data/tasks/ragel_task.rb +0 -124
- data/tasks/release.rake +0 -34
- data/tasks/rspec.rake +0 -6
- data/tasks/yard/default/layout/html/bubble_32x32.png +0 -0
- data/tasks/yard/default/layout/html/bubble_48x48.png +0 -0
- data/tasks/yard/default/layout/html/footer.erb +0 -5
- data/tasks/yard/default/layout/html/index.erb +0 -1
- data/tasks/yard/default/layout/html/layout.erb +0 -25
- data/tasks/yard/default/layout/html/logo.erb +0 -1
- data/tasks/yard/default/layout/html/setup.rb +0 -4
@@ -1,1309 +0,0 @@
|
|
1
|
-
|
2
|
-
#line 1 "ragel/i18n/en_old.c.rl"
|
3
|
-
#include <assert.h>
|
4
|
-
#include <ruby.h>
|
5
|
-
|
6
|
-
#if defined(_WIN32)
|
7
|
-
#include <stddef.h>
|
8
|
-
#endif
|
9
|
-
|
10
|
-
#ifdef HAVE_RUBY_RE_H
|
11
|
-
#include <ruby/re.h>
|
12
|
-
#else
|
13
|
-
#include <re.h>
|
14
|
-
#endif
|
15
|
-
|
16
|
-
#ifdef HAVE_RUBY_ENCODING_H
|
17
|
-
#include <ruby/encoding.h>
|
18
|
-
#define ENCODED_STR_NEW(ptr, len) \
|
19
|
-
rb_enc_str_new(ptr, len, rb_utf8_encoding())
|
20
|
-
#else
|
21
|
-
#define ENCODED_STR_NEW(ptr, len) \
|
22
|
-
rb_str_new(ptr, len)
|
23
|
-
#endif
|
24
|
-
|
25
|
-
#ifndef RSTRING_PTR
|
26
|
-
#define RSTRING_PTR(s) (RSTRING(s)->ptr)
|
27
|
-
#endif
|
28
|
-
|
29
|
-
#ifndef RSTRING_LEN
|
30
|
-
#define RSTRING_LEN(s) (RSTRING(s)->len)
|
31
|
-
#endif
|
32
|
-
|
33
|
-
#define DATA_GET(FROM, TYPE, NAME) \
|
34
|
-
Data_Get_Struct(FROM, TYPE, NAME); \
|
35
|
-
if (NAME == NULL) { \
|
36
|
-
rb_raise(rb_eArgError, "NULL found for " # NAME " when it shouldn't be."); \
|
37
|
-
}
|
38
|
-
|
39
|
-
typedef struct lexer_state {
|
40
|
-
int content_len;
|
41
|
-
int line_number;
|
42
|
-
int current_line;
|
43
|
-
int start_col;
|
44
|
-
size_t mark;
|
45
|
-
size_t keyword_start;
|
46
|
-
size_t keyword_end;
|
47
|
-
size_t next_keyword_start;
|
48
|
-
size_t content_start;
|
49
|
-
size_t content_end;
|
50
|
-
size_t docstring_content_type_start;
|
51
|
-
size_t docstring_content_type_end;
|
52
|
-
size_t query_start;
|
53
|
-
size_t last_newline;
|
54
|
-
size_t final_newline;
|
55
|
-
} lexer_state;
|
56
|
-
|
57
|
-
static VALUE mGherkin;
|
58
|
-
static VALUE mGherkinLexer;
|
59
|
-
static VALUE mCLexer;
|
60
|
-
static VALUE cI18nLexer;
|
61
|
-
static VALUE rb_eGherkinLexingError;
|
62
|
-
|
63
|
-
#define LEN(AT, P) (P - data - lexer->AT)
|
64
|
-
#define MARK(M, P) (lexer->M = (P) - data)
|
65
|
-
#define PTR_TO(P) (data + lexer->P)
|
66
|
-
|
67
|
-
#define STORE_KW_END_CON(EVENT) \
|
68
|
-
store_multiline_kw_con(listener, # EVENT, \
|
69
|
-
PTR_TO(keyword_start), LEN(keyword_start, PTR_TO(keyword_end - 1)), \
|
70
|
-
PTR_TO(content_start), LEN(content_start, PTR_TO(content_end)), \
|
71
|
-
lexer->current_line, lexer->start_col); \
|
72
|
-
if (lexer->content_end != 0) { \
|
73
|
-
p = PTR_TO(content_end - 1); \
|
74
|
-
} \
|
75
|
-
lexer->content_end = 0
|
76
|
-
|
77
|
-
#define STORE_ATTR(ATTR) \
|
78
|
-
store_attr(listener, # ATTR, \
|
79
|
-
PTR_TO(content_start), LEN(content_start, p), \
|
80
|
-
lexer->line_number)
|
81
|
-
|
82
|
-
|
83
|
-
#line 254 "ragel/i18n/en_old.c.rl"
|
84
|
-
|
85
|
-
|
86
|
-
/** Data **/
|
87
|
-
|
88
|
-
#line 89 "ext/gherkin_lexer_en_old/gherkin_lexer_en_old.c"
|
89
|
-
static const char _lexer_actions[] = {
|
90
|
-
0, 1, 0, 1, 1, 1, 2, 1,
|
91
|
-
3, 1, 4, 1, 5, 1, 6, 1,
|
92
|
-
7, 1, 8, 1, 9, 1, 10, 1,
|
93
|
-
11, 1, 12, 1, 13, 1, 16, 1,
|
94
|
-
17, 1, 18, 1, 19, 1, 20, 1,
|
95
|
-
21, 1, 22, 1, 23, 2, 1, 18,
|
96
|
-
2, 4, 5, 2, 13, 0, 2, 14,
|
97
|
-
15, 2, 17, 0, 2, 17, 2, 2,
|
98
|
-
17, 16, 2, 17, 19, 2, 18, 6,
|
99
|
-
2, 18, 7, 2, 18, 8, 2, 18,
|
100
|
-
9, 2, 18, 10, 2, 18, 16, 2,
|
101
|
-
20, 21, 2, 22, 0, 2, 22, 2,
|
102
|
-
2, 22, 16, 2, 22, 19, 3, 3,
|
103
|
-
14, 15, 3, 5, 14, 15, 3, 11,
|
104
|
-
14, 15, 3, 12, 14, 15, 3, 13,
|
105
|
-
14, 15, 3, 14, 15, 18, 3, 17,
|
106
|
-
0, 11, 3, 17, 14, 15, 4, 1,
|
107
|
-
14, 15, 18, 4, 4, 5, 14, 15,
|
108
|
-
4, 17, 0, 14, 15, 5, 17, 0,
|
109
|
-
11, 14, 15
|
110
|
-
};
|
111
|
-
|
112
|
-
static const short _lexer_key_offsets[] = {
|
113
|
-
0, 0, 18, 21, 22, 23, 24, 25,
|
114
|
-
40, 43, 46, 48, 65, 69, 71, 72,
|
115
|
-
75, 77, 94, 95, 96, 98, 100, 105,
|
116
|
-
110, 115, 120, 124, 128, 130, 131, 132,
|
117
|
-
133, 134, 135, 136, 137, 138, 139, 140,
|
118
|
-
141, 142, 143, 144, 145, 146, 148, 153,
|
119
|
-
160, 165, 167, 168, 170, 171, 172, 173,
|
120
|
-
174, 175, 186, 188, 190, 192, 209, 210,
|
121
|
-
211, 213, 214, 216, 218, 219, 220, 221,
|
122
|
-
222, 229, 231, 234, 236, 238, 240, 242,
|
123
|
-
243, 244, 246, 247, 248, 250, 251, 252,
|
124
|
-
253, 254, 255, 256, 257, 258, 259, 274,
|
125
|
-
277, 280, 282, 299, 303, 305, 306, 309,
|
126
|
-
312, 315, 318, 319, 320, 321, 322, 323,
|
127
|
-
325, 326, 329, 332, 336, 342, 345, 347,
|
128
|
-
353, 370, 372, 374, 376, 379, 381, 398,
|
129
|
-
402, 404, 406, 408, 410, 412, 414, 416,
|
130
|
-
418, 420, 422, 424, 426, 428, 430, 432,
|
131
|
-
434, 437, 439, 441, 443, 445, 447, 449,
|
132
|
-
451, 453, 455, 458, 460, 478, 479, 480,
|
133
|
-
481, 482, 497, 501, 503, 505, 508, 510,
|
134
|
-
527, 531, 532, 533, 535, 537, 539, 542,
|
135
|
-
544, 561, 565, 567, 569, 571, 573, 575,
|
136
|
-
577, 579, 581, 583, 585, 587, 589, 591,
|
137
|
-
593, 596, 598, 601, 603, 605, 607, 609,
|
138
|
-
611, 613, 615, 618, 620, 622, 625, 627,
|
139
|
-
629, 631, 633, 635, 637, 639, 641, 644,
|
140
|
-
646, 664, 665, 667, 669, 671, 673, 675,
|
141
|
-
677, 679, 681, 683, 685, 687, 689, 691,
|
142
|
-
693, 695, 697, 700, 702, 704, 706, 709,
|
143
|
-
711, 714, 717, 719, 721, 723, 726, 728,
|
144
|
-
730, 733, 735, 737, 739, 741, 743, 745,
|
145
|
-
747, 748, 751, 752, 753, 755, 757, 759,
|
146
|
-
762, 764, 781, 785, 787, 789, 791, 793,
|
147
|
-
795, 797, 799, 801, 803, 805, 807, 809,
|
148
|
-
811, 813, 815, 817, 820, 822, 824, 826,
|
149
|
-
828, 830, 832, 834, 836, 839, 841, 843,
|
150
|
-
846, 848, 850, 852, 854, 856, 858, 860,
|
151
|
-
862, 865, 867, 885, 886, 887, 888
|
152
|
-
};
|
153
|
-
|
154
|
-
static const char _lexer_trans_keys[] = {
|
155
|
-
-61, -17, 10, 32, 34, 35, 37, 42,
|
156
|
-
55, 64, 65, 72, 79, 83, 84, 124,
|
157
|
-
9, 13, -122, -112, -98, 114, 58, 10,
|
158
|
-
10, -61, 10, 32, 35, 37, 42, 55,
|
159
|
-
64, 65, 72, 79, 83, 84, 9, 13,
|
160
|
-
-112, -98, 10, 10, 97, 117, 10, 32,
|
161
|
-
-61, 10, 32, 34, 35, 37, 42, 55,
|
162
|
-
64, 65, 72, 79, 83, 84, 124, 9,
|
163
|
-
13, -122, -112, -98, -80, 97, 117, 32,
|
164
|
-
-61, 10, 13, 10, 13, -61, 10, 32,
|
165
|
-
34, 35, 37, 42, 55, 64, 65, 72,
|
166
|
-
79, 83, 84, 124, 9, 13, 34, 34,
|
167
|
-
10, 13, 10, 13, 10, 32, 34, 9,
|
168
|
-
13, 10, 32, 34, 9, 13, 10, 32,
|
169
|
-
34, 9, 13, 10, 32, 34, 9, 13,
|
170
|
-
10, 32, 9, 13, 10, 32, 9, 13,
|
171
|
-
10, 13, 10, 95, 70, 69, 65, 84,
|
172
|
-
85, 82, 69, 95, 69, 78, 68, 95,
|
173
|
-
37, 32, 10, 13, 13, 32, 64, 9,
|
174
|
-
10, 9, 10, 13, 32, 64, 11, 12,
|
175
|
-
10, 32, 64, 9, 13, 99, 101, 119,
|
176
|
-
-61, 97, -90, 116, 58, 10, 10, -61,
|
177
|
-
10, 32, 35, 37, 64, 65, 72, 83,
|
178
|
-
9, 13, -122, 10, 10, 114, 10, 58,
|
179
|
-
-61, 10, 32, 34, 35, 37, 42, 55,
|
180
|
-
64, 65, 72, 79, 83, 84, 124, 9,
|
181
|
-
13, 110, 100, 101, 119, 32, -61, 116,
|
182
|
-
-80, -66, 101, 58, 10, 10, 10, 32,
|
183
|
-
35, 72, 124, 9, 13, 10, 119, -61,
|
184
|
-
10, 97, -90, 10, 10, 116, 10, 58,
|
185
|
-
10, 101, 104, 97, 32, 58, 104, 119,
|
186
|
-
-61, 97, -90, 114, 32, 115, 119, 97,
|
187
|
-
58, 10, 10, -61, 10, 32, 35, 37,
|
188
|
-
42, 55, 64, 65, 72, 79, 83, 84,
|
189
|
-
9, 13, -112, -98, 10, 10, 97, 117,
|
190
|
-
10, 32, -61, 10, 32, 34, 35, 37,
|
191
|
-
42, 55, 64, 65, 72, 79, 83, 84,
|
192
|
-
124, 9, 13, -122, -112, -98, -80, 97,
|
193
|
-
117, 32, -61, 10, 13, -66, 10, 13,
|
194
|
-
10, 13, 101, 10, 13, 32, 114, 104,
|
195
|
-
101, 32, 104, 97, 117, 32, 10, 13,
|
196
|
-
116, 10, 13, 104, 32, 124, 9, 13,
|
197
|
-
10, 32, 92, 124, 9, 13, 10, 92,
|
198
|
-
124, 10, 92, 10, 32, 92, 124, 9,
|
199
|
-
13, -61, 10, 32, 34, 35, 37, 42,
|
200
|
-
55, 64, 65, 72, 79, 83, 84, 124,
|
201
|
-
9, 13, 10, 114, 10, 104, 10, 32,
|
202
|
-
10, 97, 117, 10, 32, -61, 10, 32,
|
203
|
-
34, 35, 37, 42, 55, 64, 65, 72,
|
204
|
-
79, 83, 84, 124, 9, 13, -122, -112,
|
205
|
-
-98, -66, 10, 95, 10, 70, 10, 69,
|
206
|
-
10, 65, 10, 84, 10, 85, 10, 82,
|
207
|
-
10, 69, 10, 95, 10, 69, 10, 78,
|
208
|
-
10, 68, 10, 95, 10, 37, 10, 99,
|
209
|
-
10, 119, -61, 10, 97, -90, 10, 10,
|
210
|
-
116, 10, 58, 10, 101, 10, 110, 10,
|
211
|
-
100, 10, 119, 10, 97, 10, 104, 10,
|
212
|
-
97, 117, 10, 32, -61, 10, 32, 34,
|
213
|
-
35, 37, 42, 55, 64, 65, 72, 79,
|
214
|
-
83, 84, 116, 124, 9, 13, 104, 101,
|
215
|
-
10, 10, -61, 10, 32, 35, 37, 42,
|
216
|
-
55, 64, 65, 72, 79, 83, 84, 9,
|
217
|
-
13, -122, -112, -98, 10, 10, 114, 10,
|
218
|
-
58, 10, 97, 117, 10, 32, -61, 10,
|
219
|
-
32, 34, 35, 37, 42, 55, 64, 65,
|
220
|
-
72, 79, 83, 84, 124, 9, 13, -122,
|
221
|
-
-112, -98, -80, 101, 32, 10, 114, 10,
|
222
|
-
104, 10, 32, 10, 97, 117, 10, 32,
|
223
|
-
-61, 10, 32, 34, 35, 37, 42, 55,
|
224
|
-
64, 65, 72, 79, 83, 84, 124, 9,
|
225
|
-
13, -122, -112, -98, -66, 10, 95, 10,
|
226
|
-
70, 10, 69, 10, 65, 10, 84, 10,
|
227
|
-
85, 10, 82, 10, 69, 10, 95, 10,
|
228
|
-
69, 10, 78, 10, 68, 10, 95, 10,
|
229
|
-
37, 10, 99, 101, 10, 119, -61, 10,
|
230
|
-
97, -90, 10, 10, 116, 10, 101, 10,
|
231
|
-
110, 10, 100, 10, 119, 10, 97, 10,
|
232
|
-
32, 58, 10, 104, 10, 119, -61, 10,
|
233
|
-
97, -90, 10, 10, 114, 10, 32, 10,
|
234
|
-
115, 10, 119, 10, 97, 10, 101, 10,
|
235
|
-
104, 10, 97, 117, 10, 32, -61, 10,
|
236
|
-
32, 34, 35, 37, 42, 55, 64, 65,
|
237
|
-
72, 79, 83, 84, 116, 124, 9, 13,
|
238
|
-
104, 10, 95, 10, 70, 10, 69, 10,
|
239
|
-
65, 10, 84, 10, 85, 10, 82, 10,
|
240
|
-
69, 10, 95, 10, 69, 10, 78, 10,
|
241
|
-
68, 10, 95, 10, 37, 10, 101, 10,
|
242
|
-
119, -61, 10, 97, -90, 10, 10, 116,
|
243
|
-
10, 101, 10, 101, 119, 10, 32, -61,
|
244
|
-
10, 116, -80, -66, 10, 10, 101, 10,
|
245
|
-
104, 10, 97, 10, 32, 58, 10, 104,
|
246
|
-
10, 119, -61, 10, 97, -90, 10, 10,
|
247
|
-
114, 10, 32, 10, 115, 10, 119, 10,
|
248
|
-
97, 10, 101, 101, -80, 10, 13, 101,
|
249
|
-
32, 10, 114, 10, 104, 10, 32, 10,
|
250
|
-
97, 117, 10, 32, -61, 10, 32, 34,
|
251
|
-
35, 37, 42, 55, 64, 65, 72, 79,
|
252
|
-
83, 84, 124, 9, 13, -122, -112, -98,
|
253
|
-
-66, 10, 95, 10, 70, 10, 69, 10,
|
254
|
-
65, 10, 84, 10, 85, 10, 82, 10,
|
255
|
-
69, 10, 95, 10, 69, 10, 78, 10,
|
256
|
-
68, 10, 95, 10, 37, 10, 99, 10,
|
257
|
-
119, -61, 10, 97, -90, 10, 10, 116,
|
258
|
-
10, 58, 10, 101, 10, 110, 10, 100,
|
259
|
-
10, 119, 10, 97, 10, 32, 58, 10,
|
260
|
-
104, 10, 119, -61, 10, 97, -90, 10,
|
261
|
-
10, 114, 10, 32, 10, 115, 10, 119,
|
262
|
-
10, 97, 10, 101, 10, 104, 10, 97,
|
263
|
-
117, 10, 32, -61, 10, 32, 34, 35,
|
264
|
-
37, 42, 55, 64, 65, 72, 79, 83,
|
265
|
-
84, 116, 124, 9, 13, 104, -69, -65,
|
266
|
-
0
|
267
|
-
};
|
268
|
-
|
269
|
-
static const char _lexer_single_lengths[] = {
|
270
|
-
0, 16, 3, 1, 1, 1, 1, 13,
|
271
|
-
3, 3, 2, 15, 4, 2, 1, 3,
|
272
|
-
2, 15, 1, 1, 2, 2, 3, 3,
|
273
|
-
3, 3, 2, 2, 2, 1, 1, 1,
|
274
|
-
1, 1, 1, 1, 1, 1, 1, 1,
|
275
|
-
1, 1, 1, 1, 1, 2, 3, 5,
|
276
|
-
3, 2, 1, 2, 1, 1, 1, 1,
|
277
|
-
1, 9, 2, 2, 2, 15, 1, 1,
|
278
|
-
2, 1, 2, 2, 1, 1, 1, 1,
|
279
|
-
5, 2, 3, 2, 2, 2, 2, 1,
|
280
|
-
1, 2, 1, 1, 2, 1, 1, 1,
|
281
|
-
1, 1, 1, 1, 1, 1, 13, 3,
|
282
|
-
3, 2, 15, 4, 2, 1, 3, 3,
|
283
|
-
3, 3, 1, 1, 1, 1, 1, 2,
|
284
|
-
1, 3, 3, 2, 4, 3, 2, 4,
|
285
|
-
15, 2, 2, 2, 3, 2, 15, 4,
|
286
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
287
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
288
|
-
3, 2, 2, 2, 2, 2, 2, 2,
|
289
|
-
2, 2, 3, 2, 16, 1, 1, 1,
|
290
|
-
1, 13, 4, 2, 2, 3, 2, 15,
|
291
|
-
4, 1, 1, 2, 2, 2, 3, 2,
|
292
|
-
15, 4, 2, 2, 2, 2, 2, 2,
|
293
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
294
|
-
3, 2, 3, 2, 2, 2, 2, 2,
|
295
|
-
2, 2, 3, 2, 2, 3, 2, 2,
|
296
|
-
2, 2, 2, 2, 2, 2, 3, 2,
|
297
|
-
16, 1, 2, 2, 2, 2, 2, 2,
|
298
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
299
|
-
2, 2, 3, 2, 2, 2, 3, 2,
|
300
|
-
3, 3, 2, 2, 2, 3, 2, 2,
|
301
|
-
3, 2, 2, 2, 2, 2, 2, 2,
|
302
|
-
1, 3, 1, 1, 2, 2, 2, 3,
|
303
|
-
2, 15, 4, 2, 2, 2, 2, 2,
|
304
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
305
|
-
2, 2, 2, 3, 2, 2, 2, 2,
|
306
|
-
2, 2, 2, 2, 3, 2, 2, 3,
|
307
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
308
|
-
3, 2, 16, 1, 1, 1, 0
|
309
|
-
};
|
310
|
-
|
311
|
-
static const char _lexer_range_lengths[] = {
|
312
|
-
0, 1, 0, 0, 0, 0, 0, 1,
|
313
|
-
0, 0, 0, 1, 0, 0, 0, 0,
|
314
|
-
0, 1, 0, 0, 0, 0, 1, 1,
|
315
|
-
1, 1, 1, 1, 0, 0, 0, 0,
|
316
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
317
|
-
0, 0, 0, 0, 0, 0, 1, 1,
|
318
|
-
1, 0, 0, 0, 0, 0, 0, 0,
|
319
|
-
0, 1, 0, 0, 0, 1, 0, 0,
|
320
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
321
|
-
1, 0, 0, 0, 0, 0, 0, 0,
|
322
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
323
|
-
0, 0, 0, 0, 0, 0, 1, 0,
|
324
|
-
0, 0, 1, 0, 0, 0, 0, 0,
|
325
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
326
|
-
0, 0, 0, 1, 1, 0, 0, 1,
|
327
|
-
1, 0, 0, 0, 0, 0, 1, 0,
|
328
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
329
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
330
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
331
|
-
0, 0, 0, 0, 1, 0, 0, 0,
|
332
|
-
0, 1, 0, 0, 0, 0, 0, 1,
|
333
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
334
|
-
1, 0, 0, 0, 0, 0, 0, 0,
|
335
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
336
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
337
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
338
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
339
|
-
1, 0, 0, 0, 0, 0, 0, 0,
|
340
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
341
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
342
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
343
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
344
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
345
|
-
0, 1, 0, 0, 0, 0, 0, 0,
|
346
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
347
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
348
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
349
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
350
|
-
0, 0, 1, 0, 0, 0, 0
|
351
|
-
};
|
352
|
-
|
353
|
-
static const short _lexer_index_offsets[] = {
|
354
|
-
0, 0, 18, 22, 24, 26, 28, 30,
|
355
|
-
45, 49, 53, 56, 73, 78, 81, 83,
|
356
|
-
87, 90, 107, 109, 111, 114, 117, 122,
|
357
|
-
127, 132, 137, 141, 145, 148, 150, 152,
|
358
|
-
154, 156, 158, 160, 162, 164, 166, 168,
|
359
|
-
170, 172, 174, 176, 178, 180, 183, 188,
|
360
|
-
195, 200, 203, 205, 208, 210, 212, 214,
|
361
|
-
216, 218, 229, 232, 235, 238, 255, 257,
|
362
|
-
259, 262, 264, 267, 270, 272, 274, 276,
|
363
|
-
278, 285, 288, 292, 295, 298, 301, 304,
|
364
|
-
306, 308, 311, 313, 315, 318, 320, 322,
|
365
|
-
324, 326, 328, 330, 332, 334, 336, 351,
|
366
|
-
355, 359, 362, 379, 384, 387, 389, 393,
|
367
|
-
397, 401, 405, 407, 409, 411, 413, 415,
|
368
|
-
418, 420, 424, 428, 432, 438, 442, 445,
|
369
|
-
451, 468, 471, 474, 477, 481, 484, 501,
|
370
|
-
506, 509, 512, 515, 518, 521, 524, 527,
|
371
|
-
530, 533, 536, 539, 542, 545, 548, 551,
|
372
|
-
554, 558, 561, 564, 567, 570, 573, 576,
|
373
|
-
579, 582, 585, 589, 592, 610, 612, 614,
|
374
|
-
616, 618, 633, 638, 641, 644, 648, 651,
|
375
|
-
668, 673, 675, 677, 680, 683, 686, 690,
|
376
|
-
693, 710, 715, 718, 721, 724, 727, 730,
|
377
|
-
733, 736, 739, 742, 745, 748, 751, 754,
|
378
|
-
757, 761, 764, 768, 771, 774, 777, 780,
|
379
|
-
783, 786, 789, 793, 796, 799, 803, 806,
|
380
|
-
809, 812, 815, 818, 821, 824, 827, 831,
|
381
|
-
834, 852, 854, 857, 860, 863, 866, 869,
|
382
|
-
872, 875, 878, 881, 884, 887, 890, 893,
|
383
|
-
896, 899, 902, 906, 909, 912, 915, 919,
|
384
|
-
922, 926, 930, 933, 936, 939, 943, 946,
|
385
|
-
949, 953, 956, 959, 962, 965, 968, 971,
|
386
|
-
974, 976, 980, 982, 984, 987, 990, 993,
|
387
|
-
997, 1000, 1017, 1022, 1025, 1028, 1031, 1034,
|
388
|
-
1037, 1040, 1043, 1046, 1049, 1052, 1055, 1058,
|
389
|
-
1061, 1064, 1067, 1070, 1074, 1077, 1080, 1083,
|
390
|
-
1086, 1089, 1092, 1095, 1098, 1102, 1105, 1108,
|
391
|
-
1112, 1115, 1118, 1121, 1124, 1127, 1130, 1133,
|
392
|
-
1136, 1140, 1143, 1161, 1163, 1165, 1167
|
393
|
-
};
|
394
|
-
|
395
|
-
static const short _lexer_trans_targs[] = {
|
396
|
-
2, 308, 17, 17, 18, 28, 30, 44,
|
397
|
-
44, 46, 49, 50, 62, 64, 110, 115,
|
398
|
-
17, 0, 3, 13, 100, 0, 4, 0,
|
399
|
-
5, 0, 7, 6, 7, 6, 8, 7,
|
400
|
-
7, 17, 267, 262, 262, 17, 281, 282,
|
401
|
-
288, 290, 303, 7, 6, 9, 263, 7,
|
402
|
-
6, 7, 10, 260, 6, 7, 11, 6,
|
403
|
-
12, 17, 17, 18, 28, 30, 44, 44,
|
404
|
-
46, 49, 50, 62, 64, 110, 115, 17,
|
405
|
-
0, 3, 13, 100, 258, 0, 14, 106,
|
406
|
-
0, 15, 0, 257, 17, 29, 16, 17,
|
407
|
-
29, 16, 2, 17, 17, 18, 28, 30,
|
408
|
-
44, 44, 46, 49, 50, 62, 64, 110,
|
409
|
-
115, 17, 0, 19, 0, 20, 0, 22,
|
410
|
-
21, 21, 22, 21, 21, 23, 23, 24,
|
411
|
-
23, 23, 23, 23, 24, 23, 23, 23,
|
412
|
-
23, 25, 23, 23, 23, 23, 26, 23,
|
413
|
-
23, 17, 27, 27, 0, 17, 27, 27,
|
414
|
-
0, 17, 29, 28, 17, 0, 31, 0,
|
415
|
-
32, 0, 33, 0, 34, 0, 35, 0,
|
416
|
-
36, 0, 37, 0, 38, 0, 39, 0,
|
417
|
-
40, 0, 41, 0, 42, 0, 43, 0,
|
418
|
-
310, 0, 45, 0, 17, 29, 16, 0,
|
419
|
-
0, 0, 0, 47, 48, 17, 48, 48,
|
420
|
-
46, 47, 47, 17, 48, 46, 48, 0,
|
421
|
-
44, 3, 0, 51, 0, 52, 256, 0,
|
422
|
-
53, 0, 54, 0, 55, 0, 57, 56,
|
423
|
-
57, 56, 58, 57, 57, 17, 218, 17,
|
424
|
-
232, 233, 238, 57, 56, 59, 57, 56,
|
425
|
-
57, 60, 56, 57, 61, 56, 2, 17,
|
426
|
-
17, 18, 28, 30, 44, 44, 46, 49,
|
427
|
-
50, 62, 64, 110, 115, 17, 0, 63,
|
428
|
-
0, 44, 0, 65, 80, 0, 66, 0,
|
429
|
-
67, 79, 0, 68, 68, 0, 69, 0,
|
430
|
-
70, 0, 72, 71, 72, 71, 72, 72,
|
431
|
-
17, 73, 17, 72, 71, 72, 74, 71,
|
432
|
-
75, 72, 78, 71, 76, 72, 71, 72,
|
433
|
-
77, 71, 72, 61, 71, 72, 76, 71,
|
434
|
-
68, 0, 81, 0, 82, 159, 0, 83,
|
435
|
-
0, 84, 0, 85, 158, 0, 86, 0,
|
436
|
-
87, 0, 88, 0, 89, 0, 90, 0,
|
437
|
-
91, 0, 92, 0, 94, 93, 94, 93,
|
438
|
-
95, 94, 94, 17, 128, 123, 123, 17,
|
439
|
-
142, 143, 149, 151, 153, 94, 93, 96,
|
440
|
-
124, 94, 93, 94, 97, 121, 93, 94,
|
441
|
-
98, 93, 99, 17, 17, 18, 28, 30,
|
442
|
-
44, 44, 46, 49, 50, 62, 64, 110,
|
443
|
-
115, 17, 0, 3, 13, 100, 108, 0,
|
444
|
-
101, 106, 0, 102, 0, 103, 17, 29,
|
445
|
-
16, 104, 17, 29, 16, 17, 29, 105,
|
446
|
-
16, 17, 29, 45, 16, 107, 0, 44,
|
447
|
-
0, 109, 0, 61, 0, 111, 0, 112,
|
448
|
-
106, 0, 113, 0, 17, 29, 114, 16,
|
449
|
-
17, 29, 104, 16, 115, 116, 115, 0,
|
450
|
-
120, 119, 118, 116, 119, 117, 0, 118,
|
451
|
-
116, 117, 0, 118, 117, 120, 119, 118,
|
452
|
-
116, 119, 117, 2, 120, 120, 18, 28,
|
453
|
-
30, 44, 44, 46, 49, 50, 62, 64,
|
454
|
-
110, 115, 120, 0, 94, 122, 93, 94,
|
455
|
-
123, 93, 94, 61, 93, 94, 125, 121,
|
456
|
-
93, 94, 126, 93, 127, 17, 17, 18,
|
457
|
-
28, 30, 44, 44, 46, 49, 50, 62,
|
458
|
-
64, 110, 115, 17, 0, 3, 13, 100,
|
459
|
-
108, 0, 94, 129, 93, 94, 130, 93,
|
460
|
-
94, 131, 93, 94, 132, 93, 94, 133,
|
461
|
-
93, 94, 134, 93, 94, 135, 93, 94,
|
462
|
-
136, 93, 94, 137, 93, 94, 138, 93,
|
463
|
-
94, 139, 93, 94, 140, 93, 94, 141,
|
464
|
-
93, 94, 17, 93, 94, 123, 93, 94,
|
465
|
-
144, 93, 145, 94, 148, 93, 146, 94,
|
466
|
-
93, 94, 147, 93, 94, 61, 93, 94,
|
467
|
-
146, 93, 94, 150, 93, 94, 123, 93,
|
468
|
-
94, 152, 93, 94, 147, 93, 94, 154,
|
469
|
-
93, 94, 155, 121, 93, 94, 156, 93,
|
470
|
-
2, 17, 17, 18, 28, 30, 44, 44,
|
471
|
-
46, 49, 50, 62, 64, 110, 157, 115,
|
472
|
-
17, 0, 108, 0, 86, 0, 161, 160,
|
473
|
-
161, 160, 162, 161, 161, 17, 178, 173,
|
474
|
-
173, 17, 192, 193, 198, 200, 213, 161,
|
475
|
-
160, 163, 165, 174, 161, 160, 161, 164,
|
476
|
-
160, 161, 61, 160, 161, 166, 171, 160,
|
477
|
-
161, 167, 160, 168, 17, 17, 18, 28,
|
478
|
-
30, 44, 44, 46, 49, 50, 62, 64,
|
479
|
-
110, 115, 17, 0, 3, 13, 100, 169,
|
480
|
-
0, 170, 0, 61, 0, 161, 172, 160,
|
481
|
-
161, 173, 160, 161, 61, 160, 161, 175,
|
482
|
-
171, 160, 161, 176, 160, 177, 17, 17,
|
483
|
-
18, 28, 30, 44, 44, 46, 49, 50,
|
484
|
-
62, 64, 110, 115, 17, 0, 3, 13,
|
485
|
-
100, 169, 0, 161, 179, 160, 161, 180,
|
486
|
-
160, 161, 181, 160, 161, 182, 160, 161,
|
487
|
-
183, 160, 161, 184, 160, 161, 185, 160,
|
488
|
-
161, 186, 160, 161, 187, 160, 161, 188,
|
489
|
-
160, 161, 189, 160, 161, 190, 160, 161,
|
490
|
-
191, 160, 161, 17, 160, 161, 173, 163,
|
491
|
-
160, 161, 194, 160, 195, 161, 197, 160,
|
492
|
-
196, 161, 160, 161, 164, 160, 161, 196,
|
493
|
-
160, 161, 199, 160, 161, 173, 160, 161,
|
494
|
-
201, 160, 161, 202, 160, 161, 203, 61,
|
495
|
-
160, 161, 204, 160, 161, 205, 160, 206,
|
496
|
-
161, 212, 160, 207, 161, 160, 161, 208,
|
497
|
-
160, 161, 209, 160, 161, 210, 160, 161,
|
498
|
-
211, 160, 161, 164, 160, 161, 207, 160,
|
499
|
-
161, 214, 160, 161, 215, 171, 160, 161,
|
500
|
-
216, 160, 2, 17, 17, 18, 28, 30,
|
501
|
-
44, 44, 46, 49, 50, 62, 64, 110,
|
502
|
-
217, 115, 17, 0, 169, 0, 57, 219,
|
503
|
-
56, 57, 220, 56, 57, 221, 56, 57,
|
504
|
-
222, 56, 57, 223, 56, 57, 224, 56,
|
505
|
-
57, 225, 56, 57, 226, 56, 57, 227,
|
506
|
-
56, 57, 228, 56, 57, 229, 56, 57,
|
507
|
-
230, 56, 57, 231, 56, 57, 17, 56,
|
508
|
-
57, 59, 56, 57, 234, 56, 235, 57,
|
509
|
-
237, 56, 236, 57, 56, 57, 60, 56,
|
510
|
-
57, 236, 56, 57, 239, 244, 56, 57,
|
511
|
-
240, 56, 241, 57, 243, 56, 242, 242,
|
512
|
-
57, 56, 57, 60, 56, 57, 242, 56,
|
513
|
-
57, 245, 56, 57, 246, 61, 56, 57,
|
514
|
-
247, 56, 57, 248, 56, 249, 57, 255,
|
515
|
-
56, 250, 57, 56, 57, 251, 56, 57,
|
516
|
-
252, 56, 57, 253, 56, 57, 254, 56,
|
517
|
-
57, 60, 56, 57, 250, 56, 53, 0,
|
518
|
-
104, 17, 29, 16, 259, 0, 61, 0,
|
519
|
-
7, 261, 6, 7, 262, 6, 7, 61,
|
520
|
-
6, 7, 264, 260, 6, 7, 265, 6,
|
521
|
-
266, 17, 17, 18, 28, 30, 44, 44,
|
522
|
-
46, 49, 50, 62, 64, 110, 115, 17,
|
523
|
-
0, 3, 13, 100, 258, 0, 7, 268,
|
524
|
-
6, 7, 269, 6, 7, 270, 6, 7,
|
525
|
-
271, 6, 7, 272, 6, 7, 273, 6,
|
526
|
-
7, 274, 6, 7, 275, 6, 7, 276,
|
527
|
-
6, 7, 277, 6, 7, 278, 6, 7,
|
528
|
-
279, 6, 7, 280, 6, 7, 17, 6,
|
529
|
-
7, 262, 6, 7, 283, 6, 284, 7,
|
530
|
-
287, 6, 285, 7, 6, 7, 286, 6,
|
531
|
-
7, 61, 6, 7, 285, 6, 7, 289,
|
532
|
-
6, 7, 262, 6, 7, 291, 6, 7,
|
533
|
-
292, 6, 7, 293, 61, 6, 7, 294,
|
534
|
-
6, 7, 295, 6, 296, 7, 302, 6,
|
535
|
-
297, 7, 6, 7, 298, 6, 7, 299,
|
536
|
-
6, 7, 300, 6, 7, 301, 6, 7,
|
537
|
-
286, 6, 7, 297, 6, 7, 304, 6,
|
538
|
-
7, 305, 260, 6, 7, 306, 6, 2,
|
539
|
-
17, 17, 18, 28, 30, 44, 44, 46,
|
540
|
-
49, 50, 62, 64, 110, 307, 115, 17,
|
541
|
-
0, 258, 0, 309, 0, 17, 0, 0,
|
542
|
-
0
|
543
|
-
};
|
544
|
-
|
545
|
-
static const unsigned char _lexer_trans_actions[] = {
|
546
|
-
29, 0, 54, 0, 5, 1, 0, 29,
|
547
|
-
29, 1, 29, 29, 29, 29, 29, 35,
|
548
|
-
0, 43, 0, 0, 0, 43, 0, 43,
|
549
|
-
0, 43, 144, 57, 54, 0, 84, 54,
|
550
|
-
0, 72, 33, 84, 84, 72, 84, 84,
|
551
|
-
84, 84, 84, 0, 0, 0, 0, 54,
|
552
|
-
0, 54, 0, 0, 0, 54, 15, 0,
|
553
|
-
63, 130, 31, 60, 57, 31, 63, 63,
|
554
|
-
57, 63, 63, 63, 63, 63, 66, 31,
|
555
|
-
43, 0, 0, 0, 0, 43, 0, 0,
|
556
|
-
43, 0, 43, 57, 149, 126, 57, 110,
|
557
|
-
23, 0, 29, 54, 0, 5, 1, 0,
|
558
|
-
29, 29, 1, 29, 29, 29, 29, 29,
|
559
|
-
35, 0, 43, 0, 43, 0, 43, 139,
|
560
|
-
48, 9, 106, 11, 0, 134, 45, 45,
|
561
|
-
45, 3, 122, 33, 33, 33, 0, 122,
|
562
|
-
33, 33, 33, 0, 122, 33, 0, 33,
|
563
|
-
0, 102, 7, 7, 43, 54, 0, 0,
|
564
|
-
43, 114, 25, 0, 54, 43, 0, 43,
|
565
|
-
0, 43, 0, 43, 0, 43, 0, 43,
|
566
|
-
0, 43, 0, 43, 0, 43, 0, 43,
|
567
|
-
0, 43, 0, 43, 0, 43, 0, 43,
|
568
|
-
0, 43, 0, 43, 149, 126, 57, 43,
|
569
|
-
43, 43, 43, 0, 27, 118, 27, 27,
|
570
|
-
51, 27, 0, 54, 0, 1, 0, 43,
|
571
|
-
0, 0, 43, 0, 43, 0, 0, 43,
|
572
|
-
0, 43, 0, 43, 0, 43, 144, 57,
|
573
|
-
54, 0, 84, 54, 0, 69, 33, 69,
|
574
|
-
84, 84, 84, 0, 0, 0, 54, 0,
|
575
|
-
54, 0, 0, 54, 13, 0, 63, 130,
|
576
|
-
31, 60, 57, 31, 63, 63, 57, 63,
|
577
|
-
63, 63, 63, 63, 66, 31, 43, 0,
|
578
|
-
43, 0, 43, 0, 0, 43, 0, 43,
|
579
|
-
0, 0, 43, 0, 0, 43, 0, 43,
|
580
|
-
0, 43, 144, 57, 54, 0, 54, 0,
|
581
|
-
81, 84, 81, 0, 0, 54, 0, 0,
|
582
|
-
0, 54, 0, 0, 0, 54, 0, 54,
|
583
|
-
0, 0, 54, 21, 0, 54, 0, 0,
|
584
|
-
0, 43, 0, 43, 0, 0, 43, 0,
|
585
|
-
43, 0, 43, 0, 0, 43, 0, 43,
|
586
|
-
0, 43, 0, 43, 0, 43, 0, 43,
|
587
|
-
0, 43, 0, 43, 144, 57, 54, 0,
|
588
|
-
84, 54, 0, 78, 33, 84, 84, 78,
|
589
|
-
84, 84, 84, 84, 84, 0, 0, 0,
|
590
|
-
0, 54, 0, 54, 0, 0, 0, 54,
|
591
|
-
19, 0, 63, 130, 31, 60, 57, 31,
|
592
|
-
63, 63, 57, 63, 63, 63, 63, 63,
|
593
|
-
66, 31, 43, 0, 0, 0, 0, 43,
|
594
|
-
0, 0, 43, 0, 43, 57, 149, 126,
|
595
|
-
57, 0, 110, 23, 0, 110, 23, 0,
|
596
|
-
0, 110, 23, 0, 0, 0, 43, 0,
|
597
|
-
43, 0, 43, 19, 43, 0, 43, 0,
|
598
|
-
0, 43, 0, 43, 149, 126, 57, 57,
|
599
|
-
110, 23, 0, 0, 0, 0, 0, 43,
|
600
|
-
54, 37, 37, 87, 37, 37, 43, 0,
|
601
|
-
39, 0, 43, 0, 0, 54, 0, 0,
|
602
|
-
39, 0, 0, 96, 54, 0, 93, 90,
|
603
|
-
41, 96, 96, 90, 96, 96, 96, 96,
|
604
|
-
96, 99, 0, 43, 54, 0, 0, 54,
|
605
|
-
0, 0, 54, 19, 0, 54, 0, 0,
|
606
|
-
0, 54, 19, 0, 63, 130, 31, 60,
|
607
|
-
57, 31, 63, 63, 57, 63, 63, 63,
|
608
|
-
63, 63, 66, 31, 43, 0, 0, 0,
|
609
|
-
0, 43, 54, 0, 0, 54, 0, 0,
|
610
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
611
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
612
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
613
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
614
|
-
0, 54, 19, 0, 54, 0, 0, 54,
|
615
|
-
0, 0, 0, 54, 0, 0, 0, 54,
|
616
|
-
0, 54, 0, 0, 54, 19, 0, 54,
|
617
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
618
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
619
|
-
0, 54, 0, 0, 0, 54, 19, 0,
|
620
|
-
63, 130, 31, 60, 57, 31, 63, 63,
|
621
|
-
57, 63, 63, 63, 63, 63, 0, 66,
|
622
|
-
31, 43, 0, 43, 0, 43, 144, 57,
|
623
|
-
54, 0, 84, 54, 0, 75, 33, 84,
|
624
|
-
84, 75, 84, 84, 84, 84, 84, 0,
|
625
|
-
0, 0, 0, 0, 54, 0, 54, 0,
|
626
|
-
0, 54, 17, 0, 54, 0, 0, 0,
|
627
|
-
54, 17, 0, 63, 130, 31, 60, 57,
|
628
|
-
31, 63, 63, 57, 63, 63, 63, 63,
|
629
|
-
63, 66, 31, 43, 0, 0, 0, 0,
|
630
|
-
43, 0, 43, 17, 43, 54, 0, 0,
|
631
|
-
54, 0, 0, 54, 17, 0, 54, 0,
|
632
|
-
0, 0, 54, 17, 0, 63, 130, 31,
|
633
|
-
60, 57, 31, 63, 63, 57, 63, 63,
|
634
|
-
63, 63, 63, 66, 31, 43, 0, 0,
|
635
|
-
0, 0, 43, 54, 0, 0, 54, 0,
|
636
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
637
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
638
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
639
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
640
|
-
0, 0, 54, 17, 0, 54, 0, 0,
|
641
|
-
0, 54, 0, 0, 0, 54, 0, 0,
|
642
|
-
0, 54, 0, 54, 0, 0, 54, 0,
|
643
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
644
|
-
0, 0, 54, 0, 0, 54, 0, 17,
|
645
|
-
0, 54, 0, 0, 54, 0, 0, 0,
|
646
|
-
54, 0, 0, 0, 54, 0, 54, 0,
|
647
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
648
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
649
|
-
54, 0, 0, 54, 0, 0, 0, 54,
|
650
|
-
17, 0, 63, 130, 31, 60, 57, 31,
|
651
|
-
63, 63, 57, 63, 63, 63, 63, 63,
|
652
|
-
0, 66, 31, 43, 0, 43, 54, 0,
|
653
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
654
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
655
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
656
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
657
|
-
0, 0, 54, 0, 0, 54, 13, 0,
|
658
|
-
54, 0, 0, 54, 0, 0, 0, 54,
|
659
|
-
0, 0, 0, 54, 0, 54, 0, 0,
|
660
|
-
54, 0, 0, 54, 0, 0, 0, 54,
|
661
|
-
0, 0, 0, 54, 0, 0, 0, 0,
|
662
|
-
54, 0, 54, 0, 0, 54, 0, 0,
|
663
|
-
54, 0, 0, 54, 0, 13, 0, 54,
|
664
|
-
0, 0, 54, 0, 0, 0, 54, 0,
|
665
|
-
0, 0, 54, 0, 54, 0, 0, 54,
|
666
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
667
|
-
54, 0, 0, 54, 0, 0, 0, 43,
|
668
|
-
0, 110, 23, 0, 0, 43, 15, 43,
|
669
|
-
54, 0, 0, 54, 0, 0, 54, 15,
|
670
|
-
0, 54, 0, 0, 0, 54, 15, 0,
|
671
|
-
63, 130, 31, 60, 57, 31, 63, 63,
|
672
|
-
57, 63, 63, 63, 63, 63, 66, 31,
|
673
|
-
43, 0, 0, 0, 0, 43, 54, 0,
|
674
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
675
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
676
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
677
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
678
|
-
0, 0, 54, 0, 0, 54, 15, 0,
|
679
|
-
54, 0, 0, 54, 0, 0, 0, 54,
|
680
|
-
0, 0, 0, 54, 0, 54, 0, 0,
|
681
|
-
54, 15, 0, 54, 0, 0, 54, 0,
|
682
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
683
|
-
0, 0, 54, 0, 15, 0, 54, 0,
|
684
|
-
0, 54, 0, 0, 0, 54, 0, 0,
|
685
|
-
0, 54, 0, 54, 0, 0, 54, 0,
|
686
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
687
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
688
|
-
54, 0, 0, 0, 54, 15, 0, 63,
|
689
|
-
130, 31, 60, 57, 31, 63, 63, 57,
|
690
|
-
63, 63, 63, 63, 63, 0, 66, 31,
|
691
|
-
43, 0, 43, 0, 43, 0, 43, 0,
|
692
|
-
0
|
693
|
-
};
|
694
|
-
|
695
|
-
static const unsigned char _lexer_eof_actions[] = {
|
696
|
-
0, 43, 43, 43, 43, 43, 43, 43,
|
697
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
698
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
699
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
700
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
701
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
702
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
703
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
704
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
705
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
706
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
707
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
708
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
709
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
710
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
711
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
712
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
713
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
714
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
715
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
716
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
717
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
718
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
719
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
720
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
721
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
722
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
723
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
724
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
725
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
726
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
727
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
728
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
729
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
730
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
731
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
732
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
733
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
734
|
-
43, 43, 43, 43, 43, 43, 43
|
735
|
-
};
|
736
|
-
|
737
|
-
static const int lexer_start = 1;
|
738
|
-
static const int lexer_first_final = 310;
|
739
|
-
static const int lexer_error = 0;
|
740
|
-
|
741
|
-
static const int lexer_en_main = 1;
|
742
|
-
|
743
|
-
|
744
|
-
#line 258 "ragel/i18n/en_old.c.rl"
|
745
|
-
|
746
|
-
static VALUE
|
747
|
-
unindent(VALUE con, int start_col)
|
748
|
-
{
|
749
|
-
VALUE re;
|
750
|
-
/* Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters */
|
751
|
-
char pat[32];
|
752
|
-
snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
|
753
|
-
re = rb_reg_regcomp(rb_str_new2(pat));
|
754
|
-
rb_funcall(con, rb_intern("gsub!"), 2, re, rb_str_new2(""));
|
755
|
-
|
756
|
-
return Qnil;
|
757
|
-
|
758
|
-
}
|
759
|
-
|
760
|
-
static void
|
761
|
-
store_kw_con(VALUE listener, const char * event_name,
|
762
|
-
const char * keyword_at, size_t keyword_length,
|
763
|
-
const char * at, size_t length,
|
764
|
-
int current_line)
|
765
|
-
{
|
766
|
-
VALUE con = Qnil, kw = Qnil;
|
767
|
-
kw = ENCODED_STR_NEW(keyword_at, keyword_length);
|
768
|
-
con = ENCODED_STR_NEW(at, length);
|
769
|
-
rb_funcall(con, rb_intern("strip!"), 0);
|
770
|
-
rb_funcall(listener, rb_intern(event_name), 3, kw, con, INT2FIX(current_line));
|
771
|
-
}
|
772
|
-
|
773
|
-
static void
|
774
|
-
store_multiline_kw_con(VALUE listener, const char * event_name,
|
775
|
-
const char * keyword_at, size_t keyword_length,
|
776
|
-
const char * at, size_t length,
|
777
|
-
int current_line, int start_col)
|
778
|
-
{
|
779
|
-
VALUE split;
|
780
|
-
VALUE con = Qnil, kw = Qnil, name = Qnil, desc = Qnil;
|
781
|
-
|
782
|
-
kw = ENCODED_STR_NEW(keyword_at, keyword_length);
|
783
|
-
con = ENCODED_STR_NEW(at, length);
|
784
|
-
|
785
|
-
unindent(con, start_col);
|
786
|
-
|
787
|
-
split = rb_str_split(con, "\n");
|
788
|
-
|
789
|
-
name = rb_funcall(split, rb_intern("shift"), 0);
|
790
|
-
desc = rb_ary_join(split, rb_str_new2( "\n" ));
|
791
|
-
|
792
|
-
if( name == Qnil )
|
793
|
-
{
|
794
|
-
name = rb_str_new2("");
|
795
|
-
}
|
796
|
-
if( rb_funcall(desc, rb_intern("size"), 0) == 0)
|
797
|
-
{
|
798
|
-
desc = rb_str_new2("");
|
799
|
-
}
|
800
|
-
rb_funcall(name, rb_intern("strip!"), 0);
|
801
|
-
rb_funcall(desc, rb_intern("rstrip!"), 0);
|
802
|
-
rb_funcall(listener, rb_intern(event_name), 4, kw, name, desc, INT2FIX(current_line));
|
803
|
-
}
|
804
|
-
|
805
|
-
static void
|
806
|
-
store_attr(VALUE listener, const char * attr_type,
|
807
|
-
const char * at, size_t length,
|
808
|
-
int line)
|
809
|
-
{
|
810
|
-
VALUE val = ENCODED_STR_NEW(at, length);
|
811
|
-
rb_funcall(listener, rb_intern(attr_type), 2, val, INT2FIX(line));
|
812
|
-
}
|
813
|
-
static void
|
814
|
-
store_docstring_content(VALUE listener,
|
815
|
-
int start_col,
|
816
|
-
const char *type_at, size_t type_length,
|
817
|
-
const char *at, size_t length,
|
818
|
-
int current_line)
|
819
|
-
{
|
820
|
-
VALUE re2;
|
821
|
-
VALUE unescape_escaped_quotes;
|
822
|
-
VALUE con = ENCODED_STR_NEW(at, length);
|
823
|
-
VALUE con_type = ENCODED_STR_NEW(type_at, type_length);
|
824
|
-
|
825
|
-
unindent(con, start_col);
|
826
|
-
|
827
|
-
re2 = rb_reg_regcomp(rb_str_new2("\r\\Z"));
|
828
|
-
unescape_escaped_quotes = rb_reg_regcomp(rb_str_new2("\\\\\"\\\\\"\\\\\""));
|
829
|
-
rb_funcall(con, rb_intern("sub!"), 2, re2, rb_str_new2(""));
|
830
|
-
rb_funcall(con_type, rb_intern("strip!"), 0);
|
831
|
-
rb_funcall(con, rb_intern("gsub!"), 2, unescape_escaped_quotes, rb_str_new2("\"\"\""));
|
832
|
-
rb_funcall(listener, rb_intern("doc_string"), 3, con_type, con, INT2FIX(current_line));
|
833
|
-
}
|
834
|
-
static void
|
835
|
-
raise_lexer_error(const char * at, int line)
|
836
|
-
{
|
837
|
-
rb_raise(rb_eGherkinLexingError, "Lexing error on line %d: '%s'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information.", line, at);
|
838
|
-
}
|
839
|
-
|
840
|
-
static void lexer_init(lexer_state *lexer) {
|
841
|
-
lexer->content_start = 0;
|
842
|
-
lexer->content_end = 0;
|
843
|
-
lexer->content_len = 0;
|
844
|
-
lexer->docstring_content_type_start = 0;
|
845
|
-
lexer->docstring_content_type_end = 0;
|
846
|
-
lexer->mark = 0;
|
847
|
-
lexer->keyword_start = 0;
|
848
|
-
lexer->keyword_end = 0;
|
849
|
-
lexer->next_keyword_start = 0;
|
850
|
-
lexer->line_number = 1;
|
851
|
-
lexer->last_newline = 0;
|
852
|
-
lexer->final_newline = 0;
|
853
|
-
lexer->start_col = 0;
|
854
|
-
}
|
855
|
-
|
856
|
-
static VALUE CLexer_alloc(VALUE klass)
|
857
|
-
{
|
858
|
-
VALUE obj;
|
859
|
-
lexer_state *lxr = ALLOC(lexer_state);
|
860
|
-
lexer_init(lxr);
|
861
|
-
|
862
|
-
obj = Data_Wrap_Struct(klass, NULL, -1, lxr);
|
863
|
-
|
864
|
-
return obj;
|
865
|
-
}
|
866
|
-
|
867
|
-
static VALUE CLexer_init(VALUE self, VALUE listener)
|
868
|
-
{
|
869
|
-
lexer_state *lxr;
|
870
|
-
rb_iv_set(self, "@listener", listener);
|
871
|
-
|
872
|
-
lxr = NULL;
|
873
|
-
DATA_GET(self, lexer_state, lxr);
|
874
|
-
lexer_init(lxr);
|
875
|
-
|
876
|
-
return self;
|
877
|
-
}
|
878
|
-
|
879
|
-
static VALUE CLexer_scan(VALUE self, VALUE input)
|
880
|
-
{
|
881
|
-
VALUE input_copy;
|
882
|
-
char *data;
|
883
|
-
size_t len;
|
884
|
-
VALUE listener = rb_iv_get(self, "@listener");
|
885
|
-
|
886
|
-
lexer_state *lexer;
|
887
|
-
lexer = NULL;
|
888
|
-
DATA_GET(self, lexer_state, lexer);
|
889
|
-
|
890
|
-
input_copy = rb_str_dup(input);
|
891
|
-
|
892
|
-
rb_str_append(input_copy, rb_str_new2("\n%_FEATURE_END_%"));
|
893
|
-
data = RSTRING_PTR(input_copy);
|
894
|
-
len = RSTRING_LEN(input_copy);
|
895
|
-
|
896
|
-
if (len == 0) {
|
897
|
-
rb_raise(rb_eGherkinLexingError, "No content to lex.");
|
898
|
-
} else {
|
899
|
-
|
900
|
-
const char *p, *pe, *eof;
|
901
|
-
int cs = 0;
|
902
|
-
|
903
|
-
VALUE current_row = Qnil;
|
904
|
-
|
905
|
-
p = data;
|
906
|
-
pe = data + len;
|
907
|
-
eof = pe;
|
908
|
-
|
909
|
-
assert(*pe == '\0' && "pointer does not end on NULL");
|
910
|
-
|
911
|
-
|
912
|
-
#line 913 "ext/gherkin_lexer_en_old/gherkin_lexer_en_old.c"
|
913
|
-
{
|
914
|
-
cs = lexer_start;
|
915
|
-
}
|
916
|
-
|
917
|
-
#line 425 "ragel/i18n/en_old.c.rl"
|
918
|
-
|
919
|
-
#line 920 "ext/gherkin_lexer_en_old/gherkin_lexer_en_old.c"
|
920
|
-
{
|
921
|
-
int _klen;
|
922
|
-
unsigned int _trans;
|
923
|
-
const char *_acts;
|
924
|
-
unsigned int _nacts;
|
925
|
-
const char *_keys;
|
926
|
-
|
927
|
-
if ( p == pe )
|
928
|
-
goto _test_eof;
|
929
|
-
if ( cs == 0 )
|
930
|
-
goto _out;
|
931
|
-
_resume:
|
932
|
-
_keys = _lexer_trans_keys + _lexer_key_offsets[cs];
|
933
|
-
_trans = _lexer_index_offsets[cs];
|
934
|
-
|
935
|
-
_klen = _lexer_single_lengths[cs];
|
936
|
-
if ( _klen > 0 ) {
|
937
|
-
const char *_lower = _keys;
|
938
|
-
const char *_mid;
|
939
|
-
const char *_upper = _keys + _klen - 1;
|
940
|
-
while (1) {
|
941
|
-
if ( _upper < _lower )
|
942
|
-
break;
|
943
|
-
|
944
|
-
_mid = _lower + ((_upper-_lower) >> 1);
|
945
|
-
if ( (*p) < *_mid )
|
946
|
-
_upper = _mid - 1;
|
947
|
-
else if ( (*p) > *_mid )
|
948
|
-
_lower = _mid + 1;
|
949
|
-
else {
|
950
|
-
_trans += (unsigned int)(_mid - _keys);
|
951
|
-
goto _match;
|
952
|
-
}
|
953
|
-
}
|
954
|
-
_keys += _klen;
|
955
|
-
_trans += _klen;
|
956
|
-
}
|
957
|
-
|
958
|
-
_klen = _lexer_range_lengths[cs];
|
959
|
-
if ( _klen > 0 ) {
|
960
|
-
const char *_lower = _keys;
|
961
|
-
const char *_mid;
|
962
|
-
const char *_upper = _keys + (_klen<<1) - 2;
|
963
|
-
while (1) {
|
964
|
-
if ( _upper < _lower )
|
965
|
-
break;
|
966
|
-
|
967
|
-
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
|
968
|
-
if ( (*p) < _mid[0] )
|
969
|
-
_upper = _mid - 2;
|
970
|
-
else if ( (*p) > _mid[1] )
|
971
|
-
_lower = _mid + 2;
|
972
|
-
else {
|
973
|
-
_trans += (unsigned int)((_mid - _keys)>>1);
|
974
|
-
goto _match;
|
975
|
-
}
|
976
|
-
}
|
977
|
-
_trans += _klen;
|
978
|
-
}
|
979
|
-
|
980
|
-
_match:
|
981
|
-
cs = _lexer_trans_targs[_trans];
|
982
|
-
|
983
|
-
if ( _lexer_trans_actions[_trans] == 0 )
|
984
|
-
goto _again;
|
985
|
-
|
986
|
-
_acts = _lexer_actions + _lexer_trans_actions[_trans];
|
987
|
-
_nacts = (unsigned int) *_acts++;
|
988
|
-
while ( _nacts-- > 0 )
|
989
|
-
{
|
990
|
-
switch ( *_acts++ )
|
991
|
-
{
|
992
|
-
case 0:
|
993
|
-
#line 83 "ragel/i18n/en_old.c.rl"
|
994
|
-
{
|
995
|
-
MARK(content_start, p);
|
996
|
-
lexer->current_line = lexer->line_number;
|
997
|
-
lexer->start_col = lexer->content_start - lexer->last_newline - (lexer->keyword_end - lexer->keyword_start) + 2;
|
998
|
-
}
|
999
|
-
break;
|
1000
|
-
case 1:
|
1001
|
-
#line 89 "ragel/i18n/en_old.c.rl"
|
1002
|
-
{
|
1003
|
-
MARK(content_start, p);
|
1004
|
-
}
|
1005
|
-
break;
|
1006
|
-
case 2:
|
1007
|
-
#line 93 "ragel/i18n/en_old.c.rl"
|
1008
|
-
{
|
1009
|
-
lexer->current_line = lexer->line_number;
|
1010
|
-
lexer->start_col = p - data - lexer->last_newline;
|
1011
|
-
}
|
1012
|
-
break;
|
1013
|
-
case 3:
|
1014
|
-
#line 98 "ragel/i18n/en_old.c.rl"
|
1015
|
-
{
|
1016
|
-
int len = LEN(content_start, PTR_TO(final_newline));
|
1017
|
-
int type_len = LEN(docstring_content_type_start, PTR_TO(docstring_content_type_end));
|
1018
|
-
|
1019
|
-
if (len < 0) len = 0;
|
1020
|
-
if (type_len < 0) len = 0;
|
1021
|
-
|
1022
|
-
store_docstring_content(listener, lexer->start_col, PTR_TO(docstring_content_type_start), type_len, PTR_TO(content_start), len, lexer->current_line);
|
1023
|
-
}
|
1024
|
-
break;
|
1025
|
-
case 4:
|
1026
|
-
#line 108 "ragel/i18n/en_old.c.rl"
|
1027
|
-
{
|
1028
|
-
MARK(docstring_content_type_start, p);
|
1029
|
-
}
|
1030
|
-
break;
|
1031
|
-
case 5:
|
1032
|
-
#line 112 "ragel/i18n/en_old.c.rl"
|
1033
|
-
{
|
1034
|
-
MARK(docstring_content_type_end, p);
|
1035
|
-
}
|
1036
|
-
break;
|
1037
|
-
case 6:
|
1038
|
-
#line 116 "ragel/i18n/en_old.c.rl"
|
1039
|
-
{
|
1040
|
-
STORE_KW_END_CON(feature);
|
1041
|
-
}
|
1042
|
-
break;
|
1043
|
-
case 7:
|
1044
|
-
#line 120 "ragel/i18n/en_old.c.rl"
|
1045
|
-
{
|
1046
|
-
STORE_KW_END_CON(background);
|
1047
|
-
}
|
1048
|
-
break;
|
1049
|
-
case 8:
|
1050
|
-
#line 124 "ragel/i18n/en_old.c.rl"
|
1051
|
-
{
|
1052
|
-
STORE_KW_END_CON(scenario);
|
1053
|
-
}
|
1054
|
-
break;
|
1055
|
-
case 9:
|
1056
|
-
#line 128 "ragel/i18n/en_old.c.rl"
|
1057
|
-
{
|
1058
|
-
STORE_KW_END_CON(scenario_outline);
|
1059
|
-
}
|
1060
|
-
break;
|
1061
|
-
case 10:
|
1062
|
-
#line 132 "ragel/i18n/en_old.c.rl"
|
1063
|
-
{
|
1064
|
-
STORE_KW_END_CON(examples);
|
1065
|
-
}
|
1066
|
-
break;
|
1067
|
-
case 11:
|
1068
|
-
#line 136 "ragel/i18n/en_old.c.rl"
|
1069
|
-
{
|
1070
|
-
store_kw_con(listener, "step",
|
1071
|
-
PTR_TO(keyword_start), LEN(keyword_start, PTR_TO(keyword_end)),
|
1072
|
-
PTR_TO(content_start), LEN(content_start, p),
|
1073
|
-
lexer->current_line);
|
1074
|
-
}
|
1075
|
-
break;
|
1076
|
-
case 12:
|
1077
|
-
#line 143 "ragel/i18n/en_old.c.rl"
|
1078
|
-
{
|
1079
|
-
STORE_ATTR(comment);
|
1080
|
-
lexer->mark = 0;
|
1081
|
-
}
|
1082
|
-
break;
|
1083
|
-
case 13:
|
1084
|
-
#line 148 "ragel/i18n/en_old.c.rl"
|
1085
|
-
{
|
1086
|
-
STORE_ATTR(tag);
|
1087
|
-
lexer->mark = 0;
|
1088
|
-
}
|
1089
|
-
break;
|
1090
|
-
case 14:
|
1091
|
-
#line 153 "ragel/i18n/en_old.c.rl"
|
1092
|
-
{
|
1093
|
-
lexer->line_number += 1;
|
1094
|
-
MARK(final_newline, p);
|
1095
|
-
}
|
1096
|
-
break;
|
1097
|
-
case 15:
|
1098
|
-
#line 158 "ragel/i18n/en_old.c.rl"
|
1099
|
-
{
|
1100
|
-
MARK(last_newline, p + 1);
|
1101
|
-
}
|
1102
|
-
break;
|
1103
|
-
case 16:
|
1104
|
-
#line 162 "ragel/i18n/en_old.c.rl"
|
1105
|
-
{
|
1106
|
-
if (lexer->mark == 0) {
|
1107
|
-
MARK(mark, p);
|
1108
|
-
}
|
1109
|
-
}
|
1110
|
-
break;
|
1111
|
-
case 17:
|
1112
|
-
#line 168 "ragel/i18n/en_old.c.rl"
|
1113
|
-
{
|
1114
|
-
MARK(keyword_end, p);
|
1115
|
-
MARK(keyword_start, PTR_TO(mark));
|
1116
|
-
MARK(content_start, p + 1);
|
1117
|
-
lexer->mark = 0;
|
1118
|
-
}
|
1119
|
-
break;
|
1120
|
-
case 18:
|
1121
|
-
#line 175 "ragel/i18n/en_old.c.rl"
|
1122
|
-
{
|
1123
|
-
MARK(content_end, p);
|
1124
|
-
}
|
1125
|
-
break;
|
1126
|
-
case 19:
|
1127
|
-
#line 179 "ragel/i18n/en_old.c.rl"
|
1128
|
-
{
|
1129
|
-
p = p - 1;
|
1130
|
-
lexer->current_line = lexer->line_number;
|
1131
|
-
current_row = rb_ary_new();
|
1132
|
-
}
|
1133
|
-
break;
|
1134
|
-
case 20:
|
1135
|
-
#line 185 "ragel/i18n/en_old.c.rl"
|
1136
|
-
{
|
1137
|
-
MARK(content_start, p);
|
1138
|
-
}
|
1139
|
-
break;
|
1140
|
-
case 21:
|
1141
|
-
#line 189 "ragel/i18n/en_old.c.rl"
|
1142
|
-
{
|
1143
|
-
VALUE re_pipe, re_newline, re_backslash;
|
1144
|
-
VALUE con = ENCODED_STR_NEW(PTR_TO(content_start), LEN(content_start, p));
|
1145
|
-
rb_funcall(con, rb_intern("strip!"), 0);
|
1146
|
-
re_pipe = rb_reg_regcomp(rb_str_new2("\\\\\\|"));
|
1147
|
-
re_newline = rb_reg_regcomp(rb_str_new2("\\\\n"));
|
1148
|
-
re_backslash = rb_reg_regcomp(rb_str_new2("\\\\\\\\"));
|
1149
|
-
rb_funcall(con, rb_intern("gsub!"), 2, re_pipe, rb_str_new2("|"));
|
1150
|
-
rb_funcall(con, rb_intern("gsub!"), 2, re_newline, rb_str_new2("\n"));
|
1151
|
-
rb_funcall(con, rb_intern("gsub!"), 2, re_backslash, rb_str_new2("\\"));
|
1152
|
-
|
1153
|
-
rb_ary_push(current_row, con);
|
1154
|
-
}
|
1155
|
-
break;
|
1156
|
-
case 22:
|
1157
|
-
#line 203 "ragel/i18n/en_old.c.rl"
|
1158
|
-
{
|
1159
|
-
rb_funcall(listener, rb_intern("row"), 2, current_row, INT2FIX(lexer->current_line));
|
1160
|
-
}
|
1161
|
-
break;
|
1162
|
-
case 23:
|
1163
|
-
#line 207 "ragel/i18n/en_old.c.rl"
|
1164
|
-
{
|
1165
|
-
int line;
|
1166
|
-
if (cs < lexer_first_final) {
|
1167
|
-
size_t count = 0;
|
1168
|
-
VALUE newstr_val;
|
1169
|
-
char *newstr;
|
1170
|
-
int newstr_count = 0;
|
1171
|
-
size_t len;
|
1172
|
-
const char *buff;
|
1173
|
-
if (lexer->last_newline != 0) {
|
1174
|
-
len = LEN(last_newline, eof);
|
1175
|
-
buff = PTR_TO(last_newline);
|
1176
|
-
} else {
|
1177
|
-
len = strlen(data);
|
1178
|
-
buff = data;
|
1179
|
-
}
|
1180
|
-
|
1181
|
-
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1182
|
-
newstr_val = rb_str_new(buff, len);
|
1183
|
-
newstr = RSTRING_PTR(newstr_val);
|
1184
|
-
|
1185
|
-
|
1186
|
-
for (count = 0; count < len; count++) {
|
1187
|
-
if(buff[count] == 10) {
|
1188
|
-
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1189
|
-
break;
|
1190
|
-
} else {
|
1191
|
-
if (buff[count] == '%') {
|
1192
|
-
newstr[newstr_count++] = buff[count];
|
1193
|
-
newstr[newstr_count] = buff[count];
|
1194
|
-
} else {
|
1195
|
-
newstr[newstr_count] = buff[count];
|
1196
|
-
}
|
1197
|
-
}
|
1198
|
-
newstr_count++;
|
1199
|
-
}
|
1200
|
-
|
1201
|
-
line = lexer->line_number;
|
1202
|
-
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1203
|
-
raise_lexer_error(newstr, line);
|
1204
|
-
} else {
|
1205
|
-
rb_funcall(listener, rb_intern("eof"), 0);
|
1206
|
-
}
|
1207
|
-
}
|
1208
|
-
break;
|
1209
|
-
#line 1210 "ext/gherkin_lexer_en_old/gherkin_lexer_en_old.c"
|
1210
|
-
}
|
1211
|
-
}
|
1212
|
-
|
1213
|
-
_again:
|
1214
|
-
if ( cs == 0 )
|
1215
|
-
goto _out;
|
1216
|
-
if ( ++p != pe )
|
1217
|
-
goto _resume;
|
1218
|
-
_test_eof: {}
|
1219
|
-
if ( p == eof )
|
1220
|
-
{
|
1221
|
-
const char *__acts = _lexer_actions + _lexer_eof_actions[cs];
|
1222
|
-
unsigned int __nacts = (unsigned int) *__acts++;
|
1223
|
-
while ( __nacts-- > 0 ) {
|
1224
|
-
switch ( *__acts++ ) {
|
1225
|
-
case 23:
|
1226
|
-
#line 207 "ragel/i18n/en_old.c.rl"
|
1227
|
-
{
|
1228
|
-
int line;
|
1229
|
-
if (cs < lexer_first_final) {
|
1230
|
-
size_t count = 0;
|
1231
|
-
VALUE newstr_val;
|
1232
|
-
char *newstr;
|
1233
|
-
int newstr_count = 0;
|
1234
|
-
size_t len;
|
1235
|
-
const char *buff;
|
1236
|
-
if (lexer->last_newline != 0) {
|
1237
|
-
len = LEN(last_newline, eof);
|
1238
|
-
buff = PTR_TO(last_newline);
|
1239
|
-
} else {
|
1240
|
-
len = strlen(data);
|
1241
|
-
buff = data;
|
1242
|
-
}
|
1243
|
-
|
1244
|
-
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1245
|
-
newstr_val = rb_str_new(buff, len);
|
1246
|
-
newstr = RSTRING_PTR(newstr_val);
|
1247
|
-
|
1248
|
-
|
1249
|
-
for (count = 0; count < len; count++) {
|
1250
|
-
if(buff[count] == 10) {
|
1251
|
-
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1252
|
-
break;
|
1253
|
-
} else {
|
1254
|
-
if (buff[count] == '%') {
|
1255
|
-
newstr[newstr_count++] = buff[count];
|
1256
|
-
newstr[newstr_count] = buff[count];
|
1257
|
-
} else {
|
1258
|
-
newstr[newstr_count] = buff[count];
|
1259
|
-
}
|
1260
|
-
}
|
1261
|
-
newstr_count++;
|
1262
|
-
}
|
1263
|
-
|
1264
|
-
line = lexer->line_number;
|
1265
|
-
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1266
|
-
raise_lexer_error(newstr, line);
|
1267
|
-
} else {
|
1268
|
-
rb_funcall(listener, rb_intern("eof"), 0);
|
1269
|
-
}
|
1270
|
-
}
|
1271
|
-
break;
|
1272
|
-
#line 1273 "ext/gherkin_lexer_en_old/gherkin_lexer_en_old.c"
|
1273
|
-
}
|
1274
|
-
}
|
1275
|
-
}
|
1276
|
-
|
1277
|
-
_out: {}
|
1278
|
-
}
|
1279
|
-
|
1280
|
-
#line 426 "ragel/i18n/en_old.c.rl"
|
1281
|
-
|
1282
|
-
assert(p <= pe && "data overflow after parsing execute");
|
1283
|
-
assert(lexer->content_start <= len && "content starts after data end");
|
1284
|
-
assert(lexer->mark < len && "mark is after data end");
|
1285
|
-
|
1286
|
-
/* Reset lexer by re-initializing the whole thing */
|
1287
|
-
lexer_init(lexer);
|
1288
|
-
|
1289
|
-
if (cs == lexer_error) {
|
1290
|
-
rb_raise(rb_eGherkinLexingError, "Invalid format, lexing fails.");
|
1291
|
-
} else {
|
1292
|
-
return Qtrue;
|
1293
|
-
}
|
1294
|
-
}
|
1295
|
-
}
|
1296
|
-
|
1297
|
-
void Init_gherkin_lexer_en_old()
|
1298
|
-
{
|
1299
|
-
mGherkin = rb_define_module("Gherkin");
|
1300
|
-
mGherkinLexer = rb_define_module_under(mGherkin, "Lexer");
|
1301
|
-
rb_eGherkinLexingError = rb_const_get(mGherkinLexer, rb_intern("LexingError"));
|
1302
|
-
|
1303
|
-
mCLexer = rb_define_module_under(mGherkin, "CLexer");
|
1304
|
-
cI18nLexer = rb_define_class_under(mCLexer, "En_old", rb_cObject);
|
1305
|
-
rb_define_alloc_func(cI18nLexer, CLexer_alloc);
|
1306
|
-
rb_define_method(cI18nLexer, "initialize", CLexer_init, 1);
|
1307
|
-
rb_define_method(cI18nLexer, "scan", CLexer_scan, 1);
|
1308
|
-
}
|
1309
|
-
|