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,1471 +0,0 @@
|
|
1
|
-
|
2
|
-
#line 1 "ragel/i18n/en_pirate.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_pirate.c.rl"
|
84
|
-
|
85
|
-
|
86
|
-
/** Data **/
|
87
|
-
|
88
|
-
#line 89 "ext/gherkin_lexer_en_pirate/gherkin_lexer_en_pirate.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, 19, 20, 21, 39, 40, 41,
|
114
|
-
43, 45, 50, 55, 60, 65, 69, 73,
|
115
|
-
75, 76, 77, 78, 79, 80, 81, 82,
|
116
|
-
83, 84, 85, 86, 87, 88, 89, 90,
|
117
|
-
91, 93, 95, 100, 107, 112, 115, 116,
|
118
|
-
117, 118, 119, 120, 121, 122, 123, 124,
|
119
|
-
125, 126, 127, 139, 141, 143, 145, 147,
|
120
|
-
149, 151, 153, 155, 157, 159, 161, 163,
|
121
|
-
165, 167, 169, 171, 173, 175, 177, 179,
|
122
|
-
181, 183, 185, 187, 189, 207, 208, 209,
|
123
|
-
210, 211, 212, 213, 214, 215, 216, 217,
|
124
|
-
218, 219, 220, 221, 222, 223, 224, 225,
|
125
|
-
226, 227, 228, 229, 230, 231, 232, 233,
|
126
|
-
234, 235, 236, 237, 244, 246, 248, 250,
|
127
|
-
252, 254, 256, 258, 260, 262, 264, 266,
|
128
|
-
267, 268, 269, 270, 271, 272, 273, 274,
|
129
|
-
275, 276, 277, 278, 279, 280, 281, 296,
|
130
|
-
298, 300, 302, 304, 306, 308, 310, 312,
|
131
|
-
314, 316, 318, 320, 322, 324, 326, 330,
|
132
|
-
332, 334, 336, 338, 340, 342, 344, 346,
|
133
|
-
348, 350, 352, 354, 356, 358, 360, 362,
|
134
|
-
364, 366, 368, 370, 372, 374, 376, 378,
|
135
|
-
380, 382, 384, 386, 388, 390, 392, 394,
|
136
|
-
396, 398, 400, 402, 404, 406, 408, 410,
|
137
|
-
412, 414, 416, 418, 420, 422, 424, 426,
|
138
|
-
428, 430, 432, 434, 436, 438, 440, 442,
|
139
|
-
444, 446, 448, 450, 452, 454, 456, 458,
|
140
|
-
460, 462, 464, 466, 467, 468, 469, 470,
|
141
|
-
471, 472, 473, 474, 475, 476, 477, 478,
|
142
|
-
479, 480, 481, 482, 483, 484, 485, 486,
|
143
|
-
487, 488, 489, 490, 491, 492, 493, 494,
|
144
|
-
495, 496, 497, 498, 499, 512, 514, 516,
|
145
|
-
518, 520, 522, 524, 526, 528, 530, 532,
|
146
|
-
534, 536, 538, 540, 542, 546, 548, 550,
|
147
|
-
552, 554, 556, 558, 560, 562, 564, 566,
|
148
|
-
568, 570, 572, 574, 576, 578, 580, 582,
|
149
|
-
584, 586, 588, 590, 592, 594, 596, 598,
|
150
|
-
600, 602, 604, 606, 608, 610, 612, 614,
|
151
|
-
616, 618, 620, 622, 624, 626, 628, 630,
|
152
|
-
632, 634, 636, 638, 639, 640, 641, 642,
|
153
|
-
643, 644, 645, 646, 647, 648, 662, 664,
|
154
|
-
666, 668, 670, 672, 674, 676, 678, 680,
|
155
|
-
682, 684, 686, 688, 690, 692, 696, 698,
|
156
|
-
700, 702, 704, 706, 708, 710, 712, 714,
|
157
|
-
716, 718, 720, 722, 724, 726, 728, 730,
|
158
|
-
732, 734, 736, 738, 740, 742, 744, 746,
|
159
|
-
748, 750, 752, 754, 756, 758, 760, 762,
|
160
|
-
764, 766, 768, 770, 772, 774, 776, 778,
|
161
|
-
780, 782, 784, 786, 788, 790, 792, 794,
|
162
|
-
796, 798, 800, 802, 804, 806, 808, 810,
|
163
|
-
812, 814, 816, 818, 820, 824, 830, 833,
|
164
|
-
835, 841, 859, 861, 863, 865, 867, 869,
|
165
|
-
871, 873, 875, 877, 879, 881, 883, 885,
|
166
|
-
887, 889, 891, 893, 895, 897, 899, 901,
|
167
|
-
903, 905, 907, 909, 911, 913, 915, 917,
|
168
|
-
919, 921, 923, 925, 927, 929, 931, 933,
|
169
|
-
935, 937, 939, 941, 943, 945, 947, 949,
|
170
|
-
951, 953, 955, 957, 958, 959, 960, 961
|
171
|
-
};
|
172
|
-
|
173
|
-
static const char _lexer_trans_keys[] = {
|
174
|
-
-17, 10, 32, 34, 35, 37, 42, 64,
|
175
|
-
65, 66, 68, 71, 72, 76, 83, 89,
|
176
|
-
124, 9, 13, -69, -65, 10, 32, 34,
|
177
|
-
35, 37, 42, 64, 65, 66, 68, 71,
|
178
|
-
72, 76, 83, 89, 124, 9, 13, 34,
|
179
|
-
34, 10, 13, 10, 13, 10, 32, 34,
|
180
|
-
9, 13, 10, 32, 34, 9, 13, 10,
|
181
|
-
32, 34, 9, 13, 10, 32, 34, 9,
|
182
|
-
13, 10, 32, 9, 13, 10, 32, 9,
|
183
|
-
13, 10, 13, 10, 95, 70, 69, 65,
|
184
|
-
84, 85, 82, 69, 95, 69, 78, 68,
|
185
|
-
95, 37, 32, 10, 13, 10, 13, 13,
|
186
|
-
32, 64, 9, 10, 9, 10, 13, 32,
|
187
|
-
64, 11, 12, 10, 32, 64, 9, 13,
|
188
|
-
104, 118, 121, 111, 121, 32, 109, 97,
|
189
|
-
116, 101, 121, 33, 58, 10, 10, 10,
|
190
|
-
32, 35, 37, 64, 65, 68, 72, 83,
|
191
|
-
89, 9, 13, 10, 95, 10, 70, 10,
|
192
|
-
69, 10, 65, 10, 84, 10, 85, 10,
|
193
|
-
82, 10, 69, 10, 95, 10, 69, 10,
|
194
|
-
78, 10, 68, 10, 95, 10, 37, 10,
|
195
|
-
104, 10, 111, 10, 121, 10, 32, 10,
|
196
|
-
109, 10, 97, 10, 116, 10, 101, 10,
|
197
|
-
121, 10, 33, 10, 58, 10, 32, 34,
|
198
|
-
35, 37, 42, 64, 65, 66, 68, 71,
|
199
|
-
72, 76, 83, 89, 124, 9, 13, 108,
|
200
|
-
105, 109, 101, 121, 33, 101, 97, 100,
|
201
|
-
32, 109, 101, 110, 32, 116, 101, 108,
|
202
|
-
108, 32, 110, 111, 32, 116, 97, 108,
|
203
|
-
101, 115, 58, 10, 10, 10, 32, 35,
|
204
|
-
65, 124, 9, 13, 10, 104, 10, 111,
|
205
|
-
10, 121, 10, 32, 10, 109, 10, 97,
|
206
|
-
10, 116, 10, 101, 10, 121, 10, 33,
|
207
|
-
10, 58, 97, 110, 103, 119, 97, 101,
|
208
|
-
97, 118, 101, 32, 116, 111, 58, 10,
|
209
|
-
10, 10, 32, 35, 37, 42, 64, 65,
|
210
|
-
66, 71, 72, 76, 83, 89, 9, 13,
|
211
|
-
10, 95, 10, 70, 10, 69, 10, 65,
|
212
|
-
10, 84, 10, 85, 10, 82, 10, 69,
|
213
|
-
10, 95, 10, 69, 10, 78, 10, 68,
|
214
|
-
10, 95, 10, 37, 10, 32, 10, 104,
|
215
|
-
118, 121, 10, 111, 10, 121, 10, 32,
|
216
|
-
10, 109, 10, 97, 10, 116, 10, 101,
|
217
|
-
10, 121, 10, 33, 10, 58, 10, 97,
|
218
|
-
10, 115, 10, 116, 10, 33, 10, 101,
|
219
|
-
10, 108, 10, 105, 10, 109, 10, 101,
|
220
|
-
10, 121, 10, 97, 10, 110, 10, 103,
|
221
|
-
10, 119, 10, 97, 10, 101, 10, 97,
|
222
|
-
10, 118, 10, 101, 10, 32, 10, 116,
|
223
|
-
10, 111, 10, 101, 10, 116, 10, 32,
|
224
|
-
10, 103, 10, 111, 10, 32, 10, 97,
|
225
|
-
10, 110, 10, 100, 10, 32, 10, 104,
|
226
|
-
10, 97, 10, 117, 10, 108, 10, 104,
|
227
|
-
10, 105, 10, 118, 10, 101, 10, 114,
|
228
|
-
10, 32, 10, 109, 10, 101, 10, 32,
|
229
|
-
10, 116, 10, 105, 10, 109, 10, 98,
|
230
|
-
10, 101, 10, 114, 10, 115, 10, 111,
|
231
|
-
10, 45, 10, 104, 10, 111, 10, 45,
|
232
|
-
10, 104, 101, 116, 32, 103, 111, 32,
|
233
|
-
97, 110, 100, 32, 104, 97, 117, 108,
|
234
|
-
104, 105, 118, 101, 114, 32, 109, 101,
|
235
|
-
32, 116, 105, 109, 98, 101, 114, 115,
|
236
|
-
58, 10, 10, 10, 32, 35, 37, 42,
|
237
|
-
64, 65, 66, 71, 72, 76, 9, 13,
|
238
|
-
10, 95, 10, 70, 10, 69, 10, 65,
|
239
|
-
10, 84, 10, 85, 10, 82, 10, 69,
|
240
|
-
10, 95, 10, 69, 10, 78, 10, 68,
|
241
|
-
10, 95, 10, 37, 10, 32, 10, 104,
|
242
|
-
118, 121, 10, 111, 10, 121, 10, 32,
|
243
|
-
10, 109, 10, 97, 10, 116, 10, 101,
|
244
|
-
10, 121, 10, 33, 10, 58, 10, 97,
|
245
|
-
10, 115, 10, 116, 10, 33, 10, 101,
|
246
|
-
10, 108, 10, 105, 10, 109, 10, 101,
|
247
|
-
10, 121, 10, 97, 10, 110, 10, 103,
|
248
|
-
10, 119, 10, 97, 10, 101, 10, 97,
|
249
|
-
10, 118, 10, 101, 10, 32, 10, 116,
|
250
|
-
10, 111, 10, 101, 10, 116, 10, 32,
|
251
|
-
10, 103, 10, 111, 10, 32, 10, 97,
|
252
|
-
10, 110, 10, 100, 10, 32, 10, 104,
|
253
|
-
10, 97, 10, 117, 10, 108, 111, 45,
|
254
|
-
104, 111, 45, 104, 111, 58, 10, 10,
|
255
|
-
10, 32, 35, 37, 42, 64, 65, 66,
|
256
|
-
71, 72, 76, 83, 9, 13, 10, 95,
|
257
|
-
10, 70, 10, 69, 10, 65, 10, 84,
|
258
|
-
10, 85, 10, 82, 10, 69, 10, 95,
|
259
|
-
10, 69, 10, 78, 10, 68, 10, 95,
|
260
|
-
10, 37, 10, 32, 10, 104, 118, 121,
|
261
|
-
10, 111, 10, 121, 10, 32, 10, 109,
|
262
|
-
10, 97, 10, 116, 10, 101, 10, 121,
|
263
|
-
10, 33, 10, 58, 10, 97, 10, 115,
|
264
|
-
10, 116, 10, 33, 10, 101, 10, 108,
|
265
|
-
10, 105, 10, 109, 10, 101, 10, 121,
|
266
|
-
10, 97, 10, 110, 10, 103, 10, 119,
|
267
|
-
10, 97, 10, 101, 10, 97, 10, 118,
|
268
|
-
10, 101, 10, 32, 10, 116, 10, 111,
|
269
|
-
10, 101, 10, 116, 10, 32, 10, 103,
|
270
|
-
10, 111, 10, 32, 10, 97, 10, 110,
|
271
|
-
10, 100, 10, 32, 10, 104, 10, 97,
|
272
|
-
10, 117, 10, 108, 10, 104, 10, 105,
|
273
|
-
10, 118, 10, 101, 10, 114, 10, 32,
|
274
|
-
10, 109, 10, 101, 10, 32, 10, 116,
|
275
|
-
10, 105, 10, 109, 10, 98, 10, 101,
|
276
|
-
10, 114, 10, 115, 32, 124, 9, 13,
|
277
|
-
10, 32, 92, 124, 9, 13, 10, 92,
|
278
|
-
124, 10, 92, 10, 32, 92, 124, 9,
|
279
|
-
13, 10, 32, 34, 35, 37, 42, 64,
|
280
|
-
65, 66, 68, 71, 72, 76, 83, 89,
|
281
|
-
124, 9, 13, 10, 101, 10, 97, 10,
|
282
|
-
100, 10, 32, 10, 109, 10, 101, 10,
|
283
|
-
110, 10, 32, 10, 116, 10, 101, 10,
|
284
|
-
108, 10, 108, 10, 32, 10, 110, 10,
|
285
|
-
111, 10, 32, 10, 116, 10, 97, 10,
|
286
|
-
108, 10, 101, 10, 115, 10, 101, 10,
|
287
|
-
97, 10, 118, 10, 101, 10, 32, 10,
|
288
|
-
116, 10, 111, 10, 104, 10, 105, 10,
|
289
|
-
118, 10, 101, 10, 114, 10, 32, 10,
|
290
|
-
109, 10, 101, 10, 32, 10, 116, 10,
|
291
|
-
105, 10, 109, 10, 98, 10, 101, 10,
|
292
|
-
114, 10, 111, 10, 45, 10, 104, 10,
|
293
|
-
111, 10, 45, 10, 104, 97, 115, 116,
|
294
|
-
101, 0
|
295
|
-
};
|
296
|
-
|
297
|
-
static const char _lexer_single_lengths[] = {
|
298
|
-
0, 17, 1, 1, 16, 1, 1, 2,
|
299
|
-
2, 3, 3, 3, 3, 2, 2, 2,
|
300
|
-
1, 1, 1, 1, 1, 1, 1, 1,
|
301
|
-
1, 1, 1, 1, 1, 1, 1, 1,
|
302
|
-
2, 2, 3, 5, 3, 3, 1, 1,
|
303
|
-
1, 1, 1, 1, 1, 1, 1, 1,
|
304
|
-
1, 1, 10, 2, 2, 2, 2, 2,
|
305
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
306
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
307
|
-
2, 2, 2, 2, 16, 1, 1, 1,
|
308
|
-
1, 1, 1, 1, 1, 1, 1, 1,
|
309
|
-
1, 1, 1, 1, 1, 1, 1, 1,
|
310
|
-
1, 1, 1, 1, 1, 1, 1, 1,
|
311
|
-
1, 1, 1, 5, 2, 2, 2, 2,
|
312
|
-
2, 2, 2, 2, 2, 2, 2, 1,
|
313
|
-
1, 1, 1, 1, 1, 1, 1, 1,
|
314
|
-
1, 1, 1, 1, 1, 1, 13, 2,
|
315
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
316
|
-
2, 2, 2, 2, 2, 2, 4, 2,
|
317
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
318
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
319
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
320
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
321
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
322
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
323
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
324
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
325
|
-
2, 2, 2, 1, 1, 1, 1, 1,
|
326
|
-
1, 1, 1, 1, 1, 1, 1, 1,
|
327
|
-
1, 1, 1, 1, 1, 1, 1, 1,
|
328
|
-
1, 1, 1, 1, 1, 1, 1, 1,
|
329
|
-
1, 1, 1, 1, 11, 2, 2, 2,
|
330
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
331
|
-
2, 2, 2, 2, 4, 2, 2, 2,
|
332
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
333
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
334
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
335
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
336
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
337
|
-
2, 2, 2, 1, 1, 1, 1, 1,
|
338
|
-
1, 1, 1, 1, 1, 12, 2, 2,
|
339
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
340
|
-
2, 2, 2, 2, 2, 4, 2, 2,
|
341
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
342
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
343
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
344
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
345
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
346
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
347
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
348
|
-
2, 2, 2, 2, 2, 4, 3, 2,
|
349
|
-
4, 16, 2, 2, 2, 2, 2, 2,
|
350
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
351
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
352
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
353
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
354
|
-
2, 2, 2, 2, 2, 2, 2, 2,
|
355
|
-
2, 2, 2, 1, 1, 1, 1, 0
|
356
|
-
};
|
357
|
-
|
358
|
-
static const char _lexer_range_lengths[] = {
|
359
|
-
0, 1, 0, 0, 1, 0, 0, 0,
|
360
|
-
0, 1, 1, 1, 1, 1, 1, 0,
|
361
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
362
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
363
|
-
0, 0, 1, 1, 1, 0, 0, 0,
|
364
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
365
|
-
0, 0, 1, 0, 0, 0, 0, 0,
|
366
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
367
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
368
|
-
0, 0, 0, 0, 1, 0, 0, 0,
|
369
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
370
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
371
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
372
|
-
0, 0, 0, 1, 0, 0, 0, 0,
|
373
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
374
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
375
|
-
0, 0, 0, 0, 0, 0, 1, 0,
|
376
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
377
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
378
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
379
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
380
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
381
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
382
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
383
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
384
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
385
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
386
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
387
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
388
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
389
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
390
|
-
0, 0, 0, 0, 1, 0, 0, 0,
|
391
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
392
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
393
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
394
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
395
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
396
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
397
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
398
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
399
|
-
0, 0, 0, 0, 0, 1, 0, 0,
|
400
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
401
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
402
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
403
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
404
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
405
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
406
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
407
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
408
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
409
|
-
0, 0, 0, 0, 1, 1, 0, 0,
|
410
|
-
1, 1, 0, 0, 0, 0, 0, 0,
|
411
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
412
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
413
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
414
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
415
|
-
0, 0, 0, 0, 0, 0, 0, 0,
|
416
|
-
0, 0, 0, 0, 0, 0, 0, 0
|
417
|
-
};
|
418
|
-
|
419
|
-
static const short _lexer_index_offsets[] = {
|
420
|
-
0, 0, 19, 21, 23, 41, 43, 45,
|
421
|
-
48, 51, 56, 61, 66, 71, 75, 79,
|
422
|
-
82, 84, 86, 88, 90, 92, 94, 96,
|
423
|
-
98, 100, 102, 104, 106, 108, 110, 112,
|
424
|
-
114, 117, 120, 125, 132, 137, 141, 143,
|
425
|
-
145, 147, 149, 151, 153, 155, 157, 159,
|
426
|
-
161, 163, 165, 177, 180, 183, 186, 189,
|
427
|
-
192, 195, 198, 201, 204, 207, 210, 213,
|
428
|
-
216, 219, 222, 225, 228, 231, 234, 237,
|
429
|
-
240, 243, 246, 249, 252, 270, 272, 274,
|
430
|
-
276, 278, 280, 282, 284, 286, 288, 290,
|
431
|
-
292, 294, 296, 298, 300, 302, 304, 306,
|
432
|
-
308, 310, 312, 314, 316, 318, 320, 322,
|
433
|
-
324, 326, 328, 330, 337, 340, 343, 346,
|
434
|
-
349, 352, 355, 358, 361, 364, 367, 370,
|
435
|
-
372, 374, 376, 378, 380, 382, 384, 386,
|
436
|
-
388, 390, 392, 394, 396, 398, 400, 415,
|
437
|
-
418, 421, 424, 427, 430, 433, 436, 439,
|
438
|
-
442, 445, 448, 451, 454, 457, 460, 465,
|
439
|
-
468, 471, 474, 477, 480, 483, 486, 489,
|
440
|
-
492, 495, 498, 501, 504, 507, 510, 513,
|
441
|
-
516, 519, 522, 525, 528, 531, 534, 537,
|
442
|
-
540, 543, 546, 549, 552, 555, 558, 561,
|
443
|
-
564, 567, 570, 573, 576, 579, 582, 585,
|
444
|
-
588, 591, 594, 597, 600, 603, 606, 609,
|
445
|
-
612, 615, 618, 621, 624, 627, 630, 633,
|
446
|
-
636, 639, 642, 645, 648, 651, 654, 657,
|
447
|
-
660, 663, 666, 669, 671, 673, 675, 677,
|
448
|
-
679, 681, 683, 685, 687, 689, 691, 693,
|
449
|
-
695, 697, 699, 701, 703, 705, 707, 709,
|
450
|
-
711, 713, 715, 717, 719, 721, 723, 725,
|
451
|
-
727, 729, 731, 733, 735, 748, 751, 754,
|
452
|
-
757, 760, 763, 766, 769, 772, 775, 778,
|
453
|
-
781, 784, 787, 790, 793, 798, 801, 804,
|
454
|
-
807, 810, 813, 816, 819, 822, 825, 828,
|
455
|
-
831, 834, 837, 840, 843, 846, 849, 852,
|
456
|
-
855, 858, 861, 864, 867, 870, 873, 876,
|
457
|
-
879, 882, 885, 888, 891, 894, 897, 900,
|
458
|
-
903, 906, 909, 912, 915, 918, 921, 924,
|
459
|
-
927, 930, 933, 936, 938, 940, 942, 944,
|
460
|
-
946, 948, 950, 952, 954, 956, 970, 973,
|
461
|
-
976, 979, 982, 985, 988, 991, 994, 997,
|
462
|
-
1000, 1003, 1006, 1009, 1012, 1015, 1020, 1023,
|
463
|
-
1026, 1029, 1032, 1035, 1038, 1041, 1044, 1047,
|
464
|
-
1050, 1053, 1056, 1059, 1062, 1065, 1068, 1071,
|
465
|
-
1074, 1077, 1080, 1083, 1086, 1089, 1092, 1095,
|
466
|
-
1098, 1101, 1104, 1107, 1110, 1113, 1116, 1119,
|
467
|
-
1122, 1125, 1128, 1131, 1134, 1137, 1140, 1143,
|
468
|
-
1146, 1149, 1152, 1155, 1158, 1161, 1164, 1167,
|
469
|
-
1170, 1173, 1176, 1179, 1182, 1185, 1188, 1191,
|
470
|
-
1194, 1197, 1200, 1203, 1206, 1210, 1216, 1220,
|
471
|
-
1223, 1229, 1247, 1250, 1253, 1256, 1259, 1262,
|
472
|
-
1265, 1268, 1271, 1274, 1277, 1280, 1283, 1286,
|
473
|
-
1289, 1292, 1295, 1298, 1301, 1304, 1307, 1310,
|
474
|
-
1313, 1316, 1319, 1322, 1325, 1328, 1331, 1334,
|
475
|
-
1337, 1340, 1343, 1346, 1349, 1352, 1355, 1358,
|
476
|
-
1361, 1364, 1367, 1370, 1373, 1376, 1379, 1382,
|
477
|
-
1385, 1388, 1391, 1394, 1396, 1398, 1400, 1402
|
478
|
-
};
|
479
|
-
|
480
|
-
static const short _lexer_trans_targs[] = {
|
481
|
-
2, 4, 4, 5, 15, 17, 31, 34,
|
482
|
-
37, 77, 83, 119, 124, 219, 233, 315,
|
483
|
-
404, 4, 0, 3, 0, 4, 0, 4,
|
484
|
-
4, 5, 15, 17, 31, 34, 37, 77,
|
485
|
-
83, 119, 124, 219, 233, 315, 404, 4,
|
486
|
-
0, 6, 0, 7, 0, 9, 8, 8,
|
487
|
-
9, 8, 8, 10, 10, 11, 10, 10,
|
488
|
-
10, 10, 11, 10, 10, 10, 10, 12,
|
489
|
-
10, 10, 10, 10, 13, 10, 10, 4,
|
490
|
-
14, 14, 0, 4, 14, 14, 0, 4,
|
491
|
-
16, 15, 4, 0, 18, 0, 19, 0,
|
492
|
-
20, 0, 21, 0, 22, 0, 23, 0,
|
493
|
-
24, 0, 25, 0, 26, 0, 27, 0,
|
494
|
-
28, 0, 29, 0, 30, 0, 463, 0,
|
495
|
-
32, 0, 4, 16, 33, 4, 16, 33,
|
496
|
-
0, 0, 0, 0, 35, 36, 4, 36,
|
497
|
-
36, 34, 35, 35, 4, 36, 34, 36,
|
498
|
-
0, 38, 459, 462, 0, 39, 0, 40,
|
499
|
-
0, 41, 0, 42, 0, 43, 0, 44,
|
500
|
-
0, 45, 0, 46, 0, 47, 0, 48,
|
501
|
-
0, 50, 49, 50, 49, 50, 50, 4,
|
502
|
-
51, 4, 65, 410, 431, 438, 453, 50,
|
503
|
-
49, 50, 52, 49, 50, 53, 49, 50,
|
504
|
-
54, 49, 50, 55, 49, 50, 56, 49,
|
505
|
-
50, 57, 49, 50, 58, 49, 50, 59,
|
506
|
-
49, 50, 60, 49, 50, 61, 49, 50,
|
507
|
-
62, 49, 50, 63, 49, 50, 64, 49,
|
508
|
-
50, 4, 49, 50, 66, 49, 50, 67,
|
509
|
-
49, 50, 68, 49, 50, 69, 49, 50,
|
510
|
-
70, 49, 50, 71, 49, 50, 72, 49,
|
511
|
-
50, 73, 49, 50, 74, 49, 50, 75,
|
512
|
-
49, 50, 76, 49, 4, 4, 5, 15,
|
513
|
-
17, 31, 34, 37, 77, 83, 119, 124,
|
514
|
-
219, 233, 315, 404, 4, 0, 78, 0,
|
515
|
-
79, 0, 80, 0, 81, 0, 82, 0,
|
516
|
-
31, 0, 84, 0, 85, 0, 86, 0,
|
517
|
-
87, 0, 88, 0, 89, 0, 90, 0,
|
518
|
-
91, 0, 92, 0, 93, 0, 94, 0,
|
519
|
-
95, 0, 96, 0, 97, 0, 98, 0,
|
520
|
-
99, 0, 100, 0, 101, 0, 102, 0,
|
521
|
-
103, 0, 104, 0, 105, 0, 107, 106,
|
522
|
-
107, 106, 107, 107, 4, 108, 4, 107,
|
523
|
-
106, 107, 109, 106, 107, 110, 106, 107,
|
524
|
-
111, 106, 107, 112, 106, 107, 113, 106,
|
525
|
-
107, 114, 106, 107, 115, 106, 107, 116,
|
526
|
-
106, 107, 117, 106, 107, 118, 106, 107,
|
527
|
-
76, 106, 120, 0, 121, 0, 122, 0,
|
528
|
-
123, 0, 81, 0, 125, 0, 126, 0,
|
529
|
-
127, 0, 128, 0, 129, 0, 130, 0,
|
530
|
-
131, 0, 132, 0, 134, 133, 134, 133,
|
531
|
-
134, 134, 4, 135, 149, 4, 150, 166,
|
532
|
-
171, 176, 183, 197, 213, 134, 133, 134,
|
533
|
-
136, 133, 134, 137, 133, 134, 138, 133,
|
534
|
-
134, 139, 133, 134, 140, 133, 134, 141,
|
535
|
-
133, 134, 142, 133, 134, 143, 133, 134,
|
536
|
-
144, 133, 134, 145, 133, 134, 146, 133,
|
537
|
-
134, 147, 133, 134, 148, 133, 134, 4,
|
538
|
-
133, 134, 76, 133, 134, 151, 161, 165,
|
539
|
-
133, 134, 152, 133, 134, 153, 133, 134,
|
540
|
-
154, 133, 134, 155, 133, 134, 156, 133,
|
541
|
-
134, 157, 133, 134, 158, 133, 134, 159,
|
542
|
-
133, 134, 160, 133, 134, 76, 133, 134,
|
543
|
-
162, 133, 134, 163, 133, 134, 164, 133,
|
544
|
-
134, 149, 133, 134, 149, 133, 134, 167,
|
545
|
-
133, 134, 168, 133, 134, 169, 133, 134,
|
546
|
-
170, 133, 134, 164, 133, 134, 172, 133,
|
547
|
-
134, 173, 133, 134, 174, 133, 134, 175,
|
548
|
-
133, 134, 170, 133, 134, 177, 133, 134,
|
549
|
-
178, 133, 134, 179, 133, 134, 180, 133,
|
550
|
-
134, 181, 133, 134, 182, 133, 134, 160,
|
551
|
-
133, 134, 184, 133, 134, 185, 133, 134,
|
552
|
-
186, 133, 134, 187, 133, 134, 188, 133,
|
553
|
-
134, 189, 133, 134, 190, 133, 134, 191,
|
554
|
-
133, 134, 192, 133, 134, 193, 133, 134,
|
555
|
-
194, 133, 134, 195, 133, 134, 196, 133,
|
556
|
-
134, 149, 133, 134, 198, 133, 134, 199,
|
557
|
-
133, 134, 200, 133, 134, 201, 133, 134,
|
558
|
-
202, 133, 134, 203, 133, 134, 204, 133,
|
559
|
-
134, 205, 133, 134, 206, 133, 134, 207,
|
560
|
-
133, 134, 208, 133, 134, 209, 133, 134,
|
561
|
-
210, 133, 134, 211, 133, 134, 212, 133,
|
562
|
-
134, 160, 133, 134, 214, 133, 134, 215,
|
563
|
-
133, 134, 216, 133, 134, 217, 133, 134,
|
564
|
-
218, 133, 134, 182, 133, 220, 0, 221,
|
565
|
-
0, 222, 0, 223, 0, 224, 0, 225,
|
566
|
-
0, 226, 0, 227, 0, 228, 0, 229,
|
567
|
-
0, 230, 0, 231, 0, 232, 0, 31,
|
568
|
-
0, 234, 0, 235, 0, 236, 0, 237,
|
569
|
-
0, 238, 0, 239, 0, 240, 0, 241,
|
570
|
-
0, 242, 0, 243, 0, 244, 0, 245,
|
571
|
-
0, 246, 0, 247, 0, 248, 0, 249,
|
572
|
-
0, 250, 0, 252, 251, 252, 251, 252,
|
573
|
-
252, 4, 253, 267, 4, 268, 284, 289,
|
574
|
-
294, 301, 252, 251, 252, 254, 251, 252,
|
575
|
-
255, 251, 252, 256, 251, 252, 257, 251,
|
576
|
-
252, 258, 251, 252, 259, 251, 252, 260,
|
577
|
-
251, 252, 261, 251, 252, 262, 251, 252,
|
578
|
-
263, 251, 252, 264, 251, 252, 265, 251,
|
579
|
-
252, 266, 251, 252, 4, 251, 252, 76,
|
580
|
-
251, 252, 269, 279, 283, 251, 252, 270,
|
581
|
-
251, 252, 271, 251, 252, 272, 251, 252,
|
582
|
-
273, 251, 252, 274, 251, 252, 275, 251,
|
583
|
-
252, 276, 251, 252, 277, 251, 252, 278,
|
584
|
-
251, 252, 76, 251, 252, 280, 251, 252,
|
585
|
-
281, 251, 252, 282, 251, 252, 267, 251,
|
586
|
-
252, 267, 251, 252, 285, 251, 252, 286,
|
587
|
-
251, 252, 287, 251, 252, 288, 251, 252,
|
588
|
-
282, 251, 252, 290, 251, 252, 291, 251,
|
589
|
-
252, 292, 251, 252, 293, 251, 252, 288,
|
590
|
-
251, 252, 295, 251, 252, 296, 251, 252,
|
591
|
-
297, 251, 252, 298, 251, 252, 299, 251,
|
592
|
-
252, 300, 251, 252, 278, 251, 252, 302,
|
593
|
-
251, 252, 303, 251, 252, 304, 251, 252,
|
594
|
-
305, 251, 252, 306, 251, 252, 307, 251,
|
595
|
-
252, 308, 251, 252, 309, 251, 252, 310,
|
596
|
-
251, 252, 311, 251, 252, 312, 251, 252,
|
597
|
-
313, 251, 252, 314, 251, 252, 267, 251,
|
598
|
-
316, 0, 317, 0, 318, 0, 319, 0,
|
599
|
-
320, 0, 321, 0, 322, 0, 323, 0,
|
600
|
-
325, 324, 325, 324, 325, 325, 4, 326,
|
601
|
-
340, 4, 341, 357, 362, 367, 374, 388,
|
602
|
-
325, 324, 325, 327, 324, 325, 328, 324,
|
603
|
-
325, 329, 324, 325, 330, 324, 325, 331,
|
604
|
-
324, 325, 332, 324, 325, 333, 324, 325,
|
605
|
-
334, 324, 325, 335, 324, 325, 336, 324,
|
606
|
-
325, 337, 324, 325, 338, 324, 325, 339,
|
607
|
-
324, 325, 4, 324, 325, 76, 324, 325,
|
608
|
-
342, 352, 356, 324, 325, 343, 324, 325,
|
609
|
-
344, 324, 325, 345, 324, 325, 346, 324,
|
610
|
-
325, 347, 324, 325, 348, 324, 325, 349,
|
611
|
-
324, 325, 350, 324, 325, 351, 324, 325,
|
612
|
-
76, 324, 325, 353, 324, 325, 354, 324,
|
613
|
-
325, 355, 324, 325, 340, 324, 325, 340,
|
614
|
-
324, 325, 358, 324, 325, 359, 324, 325,
|
615
|
-
360, 324, 325, 361, 324, 325, 355, 324,
|
616
|
-
325, 363, 324, 325, 364, 324, 325, 365,
|
617
|
-
324, 325, 366, 324, 325, 361, 324, 325,
|
618
|
-
368, 324, 325, 369, 324, 325, 370, 324,
|
619
|
-
325, 371, 324, 325, 372, 324, 325, 373,
|
620
|
-
324, 325, 351, 324, 325, 375, 324, 325,
|
621
|
-
376, 324, 325, 377, 324, 325, 378, 324,
|
622
|
-
325, 379, 324, 325, 380, 324, 325, 381,
|
623
|
-
324, 325, 382, 324, 325, 383, 324, 325,
|
624
|
-
384, 324, 325, 385, 324, 325, 386, 324,
|
625
|
-
325, 387, 324, 325, 340, 324, 325, 389,
|
626
|
-
324, 325, 390, 324, 325, 391, 324, 325,
|
627
|
-
392, 324, 325, 393, 324, 325, 394, 324,
|
628
|
-
325, 395, 324, 325, 396, 324, 325, 397,
|
629
|
-
324, 325, 398, 324, 325, 399, 324, 325,
|
630
|
-
400, 324, 325, 401, 324, 325, 402, 324,
|
631
|
-
325, 403, 324, 325, 351, 324, 404, 405,
|
632
|
-
404, 0, 409, 408, 407, 405, 408, 406,
|
633
|
-
0, 407, 405, 406, 0, 407, 406, 409,
|
634
|
-
408, 407, 405, 408, 406, 409, 409, 5,
|
635
|
-
15, 17, 31, 34, 37, 77, 83, 119,
|
636
|
-
124, 219, 233, 315, 404, 409, 0, 50,
|
637
|
-
411, 49, 50, 412, 49, 50, 413, 49,
|
638
|
-
50, 414, 49, 50, 415, 49, 50, 416,
|
639
|
-
49, 50, 417, 49, 50, 418, 49, 50,
|
640
|
-
419, 49, 50, 420, 49, 50, 421, 49,
|
641
|
-
50, 422, 49, 50, 423, 49, 50, 424,
|
642
|
-
49, 50, 425, 49, 50, 426, 49, 50,
|
643
|
-
427, 49, 50, 428, 49, 50, 429, 49,
|
644
|
-
50, 430, 49, 50, 75, 49, 50, 432,
|
645
|
-
49, 50, 433, 49, 50, 434, 49, 50,
|
646
|
-
435, 49, 50, 436, 49, 50, 437, 49,
|
647
|
-
50, 75, 49, 50, 439, 49, 50, 440,
|
648
|
-
49, 50, 441, 49, 50, 442, 49, 50,
|
649
|
-
443, 49, 50, 444, 49, 50, 445, 49,
|
650
|
-
50, 446, 49, 50, 447, 49, 50, 448,
|
651
|
-
49, 50, 449, 49, 50, 450, 49, 50,
|
652
|
-
451, 49, 50, 452, 49, 50, 430, 49,
|
653
|
-
50, 454, 49, 50, 455, 49, 50, 456,
|
654
|
-
49, 50, 457, 49, 50, 458, 49, 50,
|
655
|
-
437, 49, 460, 0, 461, 0, 82, 0,
|
656
|
-
31, 0, 0, 0
|
657
|
-
};
|
658
|
-
|
659
|
-
static const unsigned char _lexer_trans_actions[] = {
|
660
|
-
0, 54, 0, 5, 1, 0, 29, 1,
|
661
|
-
29, 29, 29, 29, 29, 29, 29, 29,
|
662
|
-
35, 0, 43, 0, 43, 0, 43, 54,
|
663
|
-
0, 5, 1, 0, 29, 1, 29, 29,
|
664
|
-
29, 29, 29, 29, 29, 29, 35, 0,
|
665
|
-
43, 0, 43, 0, 43, 139, 48, 9,
|
666
|
-
106, 11, 0, 134, 45, 45, 45, 3,
|
667
|
-
122, 33, 33, 33, 0, 122, 33, 33,
|
668
|
-
33, 0, 122, 33, 0, 33, 0, 102,
|
669
|
-
7, 7, 43, 54, 0, 0, 43, 114,
|
670
|
-
25, 0, 54, 43, 0, 43, 0, 43,
|
671
|
-
0, 43, 0, 43, 0, 43, 0, 43,
|
672
|
-
0, 43, 0, 43, 0, 43, 0, 43,
|
673
|
-
0, 43, 0, 43, 0, 43, 0, 43,
|
674
|
-
0, 43, 149, 126, 57, 110, 23, 0,
|
675
|
-
43, 43, 43, 43, 0, 27, 118, 27,
|
676
|
-
27, 51, 27, 0, 54, 0, 1, 0,
|
677
|
-
43, 0, 0, 0, 43, 0, 43, 0,
|
678
|
-
43, 0, 43, 0, 43, 0, 43, 0,
|
679
|
-
43, 0, 43, 0, 43, 0, 43, 0,
|
680
|
-
43, 144, 57, 54, 0, 54, 0, 69,
|
681
|
-
33, 69, 84, 84, 84, 84, 84, 0,
|
682
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
683
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
684
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
685
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
686
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
687
|
-
54, 13, 0, 54, 0, 0, 54, 0,
|
688
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
689
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
690
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
691
|
-
0, 54, 13, 0, 130, 31, 60, 57,
|
692
|
-
31, 63, 57, 63, 63, 63, 63, 63,
|
693
|
-
63, 63, 63, 66, 31, 43, 0, 43,
|
694
|
-
0, 43, 0, 43, 0, 43, 0, 43,
|
695
|
-
0, 43, 0, 43, 0, 43, 0, 43,
|
696
|
-
0, 43, 0, 43, 0, 43, 0, 43,
|
697
|
-
0, 43, 0, 43, 0, 43, 0, 43,
|
698
|
-
0, 43, 0, 43, 0, 43, 0, 43,
|
699
|
-
0, 43, 0, 43, 0, 43, 0, 43,
|
700
|
-
0, 43, 0, 43, 0, 43, 144, 57,
|
701
|
-
54, 0, 54, 0, 81, 84, 81, 0,
|
702
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
703
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
704
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
705
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
706
|
-
21, 0, 0, 43, 0, 43, 0, 43,
|
707
|
-
0, 43, 0, 43, 0, 43, 0, 43,
|
708
|
-
0, 43, 0, 43, 0, 43, 0, 43,
|
709
|
-
0, 43, 0, 43, 144, 57, 54, 0,
|
710
|
-
54, 0, 75, 33, 84, 75, 84, 84,
|
711
|
-
84, 84, 84, 84, 84, 0, 0, 54,
|
712
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
713
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
714
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
715
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
716
|
-
54, 0, 0, 54, 0, 0, 54, 17,
|
717
|
-
0, 54, 17, 0, 54, 0, 0, 0,
|
718
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
719
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
720
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
721
|
-
0, 54, 0, 0, 54, 17, 0, 54,
|
722
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
723
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
724
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
725
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
726
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
727
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
728
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
729
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
730
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
731
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
732
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
733
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
734
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
735
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
736
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
737
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
738
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
739
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
740
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
741
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
742
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
743
|
-
0, 0, 54, 0, 0, 0, 43, 0,
|
744
|
-
43, 0, 43, 0, 43, 0, 43, 0,
|
745
|
-
43, 0, 43, 0, 43, 0, 43, 0,
|
746
|
-
43, 0, 43, 0, 43, 0, 43, 0,
|
747
|
-
43, 0, 43, 0, 43, 0, 43, 0,
|
748
|
-
43, 0, 43, 0, 43, 0, 43, 0,
|
749
|
-
43, 0, 43, 0, 43, 0, 43, 0,
|
750
|
-
43, 0, 43, 0, 43, 0, 43, 0,
|
751
|
-
43, 0, 43, 144, 57, 54, 0, 54,
|
752
|
-
0, 78, 33, 84, 78, 84, 84, 84,
|
753
|
-
84, 84, 0, 0, 54, 0, 0, 54,
|
754
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
755
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
756
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
757
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
758
|
-
54, 0, 0, 54, 19, 0, 54, 19,
|
759
|
-
0, 54, 0, 0, 0, 0, 54, 0,
|
760
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
761
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
762
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
763
|
-
0, 54, 19, 0, 54, 0, 0, 54,
|
764
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
765
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
766
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
767
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
768
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
769
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
770
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
771
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
772
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
773
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
774
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
775
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
776
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
777
|
-
0, 43, 0, 43, 0, 43, 0, 43,
|
778
|
-
0, 43, 0, 43, 0, 43, 0, 43,
|
779
|
-
144, 57, 54, 0, 54, 0, 72, 33,
|
780
|
-
84, 72, 84, 84, 84, 84, 84, 84,
|
781
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
782
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
783
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
784
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
785
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
786
|
-
0, 54, 15, 0, 54, 15, 0, 54,
|
787
|
-
0, 0, 0, 0, 54, 0, 0, 54,
|
788
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
789
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
790
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
791
|
-
15, 0, 54, 0, 0, 54, 0, 0,
|
792
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
793
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
794
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
795
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
796
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
797
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
798
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
799
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
800
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
801
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
802
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
803
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
804
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
805
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
806
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
807
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
808
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
809
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
810
|
-
54, 0, 0, 54, 0, 0, 0, 0,
|
811
|
-
0, 43, 54, 37, 37, 87, 37, 37,
|
812
|
-
43, 0, 39, 0, 43, 0, 0, 54,
|
813
|
-
0, 0, 39, 0, 0, 54, 0, 93,
|
814
|
-
90, 41, 96, 90, 96, 96, 96, 96,
|
815
|
-
96, 96, 96, 96, 99, 0, 43, 54,
|
816
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
817
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
818
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
819
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
820
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
821
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
822
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
823
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
824
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
825
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
826
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
827
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
828
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
829
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
830
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
831
|
-
0, 0, 54, 0, 0, 54, 0, 0,
|
832
|
-
54, 0, 0, 54, 0, 0, 54, 0,
|
833
|
-
0, 54, 0, 0, 54, 0, 0, 54,
|
834
|
-
0, 0, 0, 43, 0, 43, 0, 43,
|
835
|
-
0, 43, 0, 0
|
836
|
-
};
|
837
|
-
|
838
|
-
static const unsigned char _lexer_eof_actions[] = {
|
839
|
-
0, 43, 43, 43, 43, 43, 43, 43,
|
840
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
841
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
842
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
843
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
844
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
845
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
846
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
847
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
848
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
849
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
850
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
851
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
852
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
853
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
854
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
855
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
856
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
857
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
858
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
859
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
860
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
861
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
862
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
863
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
864
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
865
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
866
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
867
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
868
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
869
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
870
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
871
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
872
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
873
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
874
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
875
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
876
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
877
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
878
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
879
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
880
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
881
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
882
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
883
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
884
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
885
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
886
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
887
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
888
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
889
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
890
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
891
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
892
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
893
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
894
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
895
|
-
43, 43, 43, 43, 43, 43, 43, 43,
|
896
|
-
43, 43, 43, 43, 43, 43, 43, 43
|
897
|
-
};
|
898
|
-
|
899
|
-
static const int lexer_start = 1;
|
900
|
-
static const int lexer_first_final = 463;
|
901
|
-
static const int lexer_error = 0;
|
902
|
-
|
903
|
-
static const int lexer_en_main = 1;
|
904
|
-
|
905
|
-
|
906
|
-
#line 258 "ragel/i18n/en_pirate.c.rl"
|
907
|
-
|
908
|
-
static VALUE
|
909
|
-
unindent(VALUE con, int start_col)
|
910
|
-
{
|
911
|
-
VALUE re;
|
912
|
-
/* Gherkin will crash gracefully if the string representation of start_col pushes the pattern past 32 characters */
|
913
|
-
char pat[32];
|
914
|
-
snprintf(pat, 32, "^[\t ]{0,%d}", start_col);
|
915
|
-
re = rb_reg_regcomp(rb_str_new2(pat));
|
916
|
-
rb_funcall(con, rb_intern("gsub!"), 2, re, rb_str_new2(""));
|
917
|
-
|
918
|
-
return Qnil;
|
919
|
-
|
920
|
-
}
|
921
|
-
|
922
|
-
static void
|
923
|
-
store_kw_con(VALUE listener, const char * event_name,
|
924
|
-
const char * keyword_at, size_t keyword_length,
|
925
|
-
const char * at, size_t length,
|
926
|
-
int current_line)
|
927
|
-
{
|
928
|
-
VALUE con = Qnil, kw = Qnil;
|
929
|
-
kw = ENCODED_STR_NEW(keyword_at, keyword_length);
|
930
|
-
con = ENCODED_STR_NEW(at, length);
|
931
|
-
rb_funcall(con, rb_intern("strip!"), 0);
|
932
|
-
rb_funcall(listener, rb_intern(event_name), 3, kw, con, INT2FIX(current_line));
|
933
|
-
}
|
934
|
-
|
935
|
-
static void
|
936
|
-
store_multiline_kw_con(VALUE listener, const char * event_name,
|
937
|
-
const char * keyword_at, size_t keyword_length,
|
938
|
-
const char * at, size_t length,
|
939
|
-
int current_line, int start_col)
|
940
|
-
{
|
941
|
-
VALUE split;
|
942
|
-
VALUE con = Qnil, kw = Qnil, name = Qnil, desc = Qnil;
|
943
|
-
|
944
|
-
kw = ENCODED_STR_NEW(keyword_at, keyword_length);
|
945
|
-
con = ENCODED_STR_NEW(at, length);
|
946
|
-
|
947
|
-
unindent(con, start_col);
|
948
|
-
|
949
|
-
split = rb_str_split(con, "\n");
|
950
|
-
|
951
|
-
name = rb_funcall(split, rb_intern("shift"), 0);
|
952
|
-
desc = rb_ary_join(split, rb_str_new2( "\n" ));
|
953
|
-
|
954
|
-
if( name == Qnil )
|
955
|
-
{
|
956
|
-
name = rb_str_new2("");
|
957
|
-
}
|
958
|
-
if( rb_funcall(desc, rb_intern("size"), 0) == 0)
|
959
|
-
{
|
960
|
-
desc = rb_str_new2("");
|
961
|
-
}
|
962
|
-
rb_funcall(name, rb_intern("strip!"), 0);
|
963
|
-
rb_funcall(desc, rb_intern("rstrip!"), 0);
|
964
|
-
rb_funcall(listener, rb_intern(event_name), 4, kw, name, desc, INT2FIX(current_line));
|
965
|
-
}
|
966
|
-
|
967
|
-
static void
|
968
|
-
store_attr(VALUE listener, const char * attr_type,
|
969
|
-
const char * at, size_t length,
|
970
|
-
int line)
|
971
|
-
{
|
972
|
-
VALUE val = ENCODED_STR_NEW(at, length);
|
973
|
-
rb_funcall(listener, rb_intern(attr_type), 2, val, INT2FIX(line));
|
974
|
-
}
|
975
|
-
static void
|
976
|
-
store_docstring_content(VALUE listener,
|
977
|
-
int start_col,
|
978
|
-
const char *type_at, size_t type_length,
|
979
|
-
const char *at, size_t length,
|
980
|
-
int current_line)
|
981
|
-
{
|
982
|
-
VALUE re2;
|
983
|
-
VALUE unescape_escaped_quotes;
|
984
|
-
VALUE con = ENCODED_STR_NEW(at, length);
|
985
|
-
VALUE con_type = ENCODED_STR_NEW(type_at, type_length);
|
986
|
-
|
987
|
-
unindent(con, start_col);
|
988
|
-
|
989
|
-
re2 = rb_reg_regcomp(rb_str_new2("\r\\Z"));
|
990
|
-
unescape_escaped_quotes = rb_reg_regcomp(rb_str_new2("\\\\\"\\\\\"\\\\\""));
|
991
|
-
rb_funcall(con, rb_intern("sub!"), 2, re2, rb_str_new2(""));
|
992
|
-
rb_funcall(con_type, rb_intern("strip!"), 0);
|
993
|
-
rb_funcall(con, rb_intern("gsub!"), 2, unescape_escaped_quotes, rb_str_new2("\"\"\""));
|
994
|
-
rb_funcall(listener, rb_intern("doc_string"), 3, con_type, con, INT2FIX(current_line));
|
995
|
-
}
|
996
|
-
static void
|
997
|
-
raise_lexer_error(const char * at, int line)
|
998
|
-
{
|
999
|
-
rb_raise(rb_eGherkinLexingError, "Lexing error on line %d: '%s'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information.", line, at);
|
1000
|
-
}
|
1001
|
-
|
1002
|
-
static void lexer_init(lexer_state *lexer) {
|
1003
|
-
lexer->content_start = 0;
|
1004
|
-
lexer->content_end = 0;
|
1005
|
-
lexer->content_len = 0;
|
1006
|
-
lexer->docstring_content_type_start = 0;
|
1007
|
-
lexer->docstring_content_type_end = 0;
|
1008
|
-
lexer->mark = 0;
|
1009
|
-
lexer->keyword_start = 0;
|
1010
|
-
lexer->keyword_end = 0;
|
1011
|
-
lexer->next_keyword_start = 0;
|
1012
|
-
lexer->line_number = 1;
|
1013
|
-
lexer->last_newline = 0;
|
1014
|
-
lexer->final_newline = 0;
|
1015
|
-
lexer->start_col = 0;
|
1016
|
-
}
|
1017
|
-
|
1018
|
-
static VALUE CLexer_alloc(VALUE klass)
|
1019
|
-
{
|
1020
|
-
VALUE obj;
|
1021
|
-
lexer_state *lxr = ALLOC(lexer_state);
|
1022
|
-
lexer_init(lxr);
|
1023
|
-
|
1024
|
-
obj = Data_Wrap_Struct(klass, NULL, -1, lxr);
|
1025
|
-
|
1026
|
-
return obj;
|
1027
|
-
}
|
1028
|
-
|
1029
|
-
static VALUE CLexer_init(VALUE self, VALUE listener)
|
1030
|
-
{
|
1031
|
-
lexer_state *lxr;
|
1032
|
-
rb_iv_set(self, "@listener", listener);
|
1033
|
-
|
1034
|
-
lxr = NULL;
|
1035
|
-
DATA_GET(self, lexer_state, lxr);
|
1036
|
-
lexer_init(lxr);
|
1037
|
-
|
1038
|
-
return self;
|
1039
|
-
}
|
1040
|
-
|
1041
|
-
static VALUE CLexer_scan(VALUE self, VALUE input)
|
1042
|
-
{
|
1043
|
-
VALUE input_copy;
|
1044
|
-
char *data;
|
1045
|
-
size_t len;
|
1046
|
-
VALUE listener = rb_iv_get(self, "@listener");
|
1047
|
-
|
1048
|
-
lexer_state *lexer;
|
1049
|
-
lexer = NULL;
|
1050
|
-
DATA_GET(self, lexer_state, lexer);
|
1051
|
-
|
1052
|
-
input_copy = rb_str_dup(input);
|
1053
|
-
|
1054
|
-
rb_str_append(input_copy, rb_str_new2("\n%_FEATURE_END_%"));
|
1055
|
-
data = RSTRING_PTR(input_copy);
|
1056
|
-
len = RSTRING_LEN(input_copy);
|
1057
|
-
|
1058
|
-
if (len == 0) {
|
1059
|
-
rb_raise(rb_eGherkinLexingError, "No content to lex.");
|
1060
|
-
} else {
|
1061
|
-
|
1062
|
-
const char *p, *pe, *eof;
|
1063
|
-
int cs = 0;
|
1064
|
-
|
1065
|
-
VALUE current_row = Qnil;
|
1066
|
-
|
1067
|
-
p = data;
|
1068
|
-
pe = data + len;
|
1069
|
-
eof = pe;
|
1070
|
-
|
1071
|
-
assert(*pe == '\0' && "pointer does not end on NULL");
|
1072
|
-
|
1073
|
-
|
1074
|
-
#line 1075 "ext/gherkin_lexer_en_pirate/gherkin_lexer_en_pirate.c"
|
1075
|
-
{
|
1076
|
-
cs = lexer_start;
|
1077
|
-
}
|
1078
|
-
|
1079
|
-
#line 425 "ragel/i18n/en_pirate.c.rl"
|
1080
|
-
|
1081
|
-
#line 1082 "ext/gherkin_lexer_en_pirate/gherkin_lexer_en_pirate.c"
|
1082
|
-
{
|
1083
|
-
int _klen;
|
1084
|
-
unsigned int _trans;
|
1085
|
-
const char *_acts;
|
1086
|
-
unsigned int _nacts;
|
1087
|
-
const char *_keys;
|
1088
|
-
|
1089
|
-
if ( p == pe )
|
1090
|
-
goto _test_eof;
|
1091
|
-
if ( cs == 0 )
|
1092
|
-
goto _out;
|
1093
|
-
_resume:
|
1094
|
-
_keys = _lexer_trans_keys + _lexer_key_offsets[cs];
|
1095
|
-
_trans = _lexer_index_offsets[cs];
|
1096
|
-
|
1097
|
-
_klen = _lexer_single_lengths[cs];
|
1098
|
-
if ( _klen > 0 ) {
|
1099
|
-
const char *_lower = _keys;
|
1100
|
-
const char *_mid;
|
1101
|
-
const char *_upper = _keys + _klen - 1;
|
1102
|
-
while (1) {
|
1103
|
-
if ( _upper < _lower )
|
1104
|
-
break;
|
1105
|
-
|
1106
|
-
_mid = _lower + ((_upper-_lower) >> 1);
|
1107
|
-
if ( (*p) < *_mid )
|
1108
|
-
_upper = _mid - 1;
|
1109
|
-
else if ( (*p) > *_mid )
|
1110
|
-
_lower = _mid + 1;
|
1111
|
-
else {
|
1112
|
-
_trans += (unsigned int)(_mid - _keys);
|
1113
|
-
goto _match;
|
1114
|
-
}
|
1115
|
-
}
|
1116
|
-
_keys += _klen;
|
1117
|
-
_trans += _klen;
|
1118
|
-
}
|
1119
|
-
|
1120
|
-
_klen = _lexer_range_lengths[cs];
|
1121
|
-
if ( _klen > 0 ) {
|
1122
|
-
const char *_lower = _keys;
|
1123
|
-
const char *_mid;
|
1124
|
-
const char *_upper = _keys + (_klen<<1) - 2;
|
1125
|
-
while (1) {
|
1126
|
-
if ( _upper < _lower )
|
1127
|
-
break;
|
1128
|
-
|
1129
|
-
_mid = _lower + (((_upper-_lower) >> 1) & ~1);
|
1130
|
-
if ( (*p) < _mid[0] )
|
1131
|
-
_upper = _mid - 2;
|
1132
|
-
else if ( (*p) > _mid[1] )
|
1133
|
-
_lower = _mid + 2;
|
1134
|
-
else {
|
1135
|
-
_trans += (unsigned int)((_mid - _keys)>>1);
|
1136
|
-
goto _match;
|
1137
|
-
}
|
1138
|
-
}
|
1139
|
-
_trans += _klen;
|
1140
|
-
}
|
1141
|
-
|
1142
|
-
_match:
|
1143
|
-
cs = _lexer_trans_targs[_trans];
|
1144
|
-
|
1145
|
-
if ( _lexer_trans_actions[_trans] == 0 )
|
1146
|
-
goto _again;
|
1147
|
-
|
1148
|
-
_acts = _lexer_actions + _lexer_trans_actions[_trans];
|
1149
|
-
_nacts = (unsigned int) *_acts++;
|
1150
|
-
while ( _nacts-- > 0 )
|
1151
|
-
{
|
1152
|
-
switch ( *_acts++ )
|
1153
|
-
{
|
1154
|
-
case 0:
|
1155
|
-
#line 83 "ragel/i18n/en_pirate.c.rl"
|
1156
|
-
{
|
1157
|
-
MARK(content_start, p);
|
1158
|
-
lexer->current_line = lexer->line_number;
|
1159
|
-
lexer->start_col = lexer->content_start - lexer->last_newline - (lexer->keyword_end - lexer->keyword_start) + 2;
|
1160
|
-
}
|
1161
|
-
break;
|
1162
|
-
case 1:
|
1163
|
-
#line 89 "ragel/i18n/en_pirate.c.rl"
|
1164
|
-
{
|
1165
|
-
MARK(content_start, p);
|
1166
|
-
}
|
1167
|
-
break;
|
1168
|
-
case 2:
|
1169
|
-
#line 93 "ragel/i18n/en_pirate.c.rl"
|
1170
|
-
{
|
1171
|
-
lexer->current_line = lexer->line_number;
|
1172
|
-
lexer->start_col = p - data - lexer->last_newline;
|
1173
|
-
}
|
1174
|
-
break;
|
1175
|
-
case 3:
|
1176
|
-
#line 98 "ragel/i18n/en_pirate.c.rl"
|
1177
|
-
{
|
1178
|
-
int len = LEN(content_start, PTR_TO(final_newline));
|
1179
|
-
int type_len = LEN(docstring_content_type_start, PTR_TO(docstring_content_type_end));
|
1180
|
-
|
1181
|
-
if (len < 0) len = 0;
|
1182
|
-
if (type_len < 0) len = 0;
|
1183
|
-
|
1184
|
-
store_docstring_content(listener, lexer->start_col, PTR_TO(docstring_content_type_start), type_len, PTR_TO(content_start), len, lexer->current_line);
|
1185
|
-
}
|
1186
|
-
break;
|
1187
|
-
case 4:
|
1188
|
-
#line 108 "ragel/i18n/en_pirate.c.rl"
|
1189
|
-
{
|
1190
|
-
MARK(docstring_content_type_start, p);
|
1191
|
-
}
|
1192
|
-
break;
|
1193
|
-
case 5:
|
1194
|
-
#line 112 "ragel/i18n/en_pirate.c.rl"
|
1195
|
-
{
|
1196
|
-
MARK(docstring_content_type_end, p);
|
1197
|
-
}
|
1198
|
-
break;
|
1199
|
-
case 6:
|
1200
|
-
#line 116 "ragel/i18n/en_pirate.c.rl"
|
1201
|
-
{
|
1202
|
-
STORE_KW_END_CON(feature);
|
1203
|
-
}
|
1204
|
-
break;
|
1205
|
-
case 7:
|
1206
|
-
#line 120 "ragel/i18n/en_pirate.c.rl"
|
1207
|
-
{
|
1208
|
-
STORE_KW_END_CON(background);
|
1209
|
-
}
|
1210
|
-
break;
|
1211
|
-
case 8:
|
1212
|
-
#line 124 "ragel/i18n/en_pirate.c.rl"
|
1213
|
-
{
|
1214
|
-
STORE_KW_END_CON(scenario);
|
1215
|
-
}
|
1216
|
-
break;
|
1217
|
-
case 9:
|
1218
|
-
#line 128 "ragel/i18n/en_pirate.c.rl"
|
1219
|
-
{
|
1220
|
-
STORE_KW_END_CON(scenario_outline);
|
1221
|
-
}
|
1222
|
-
break;
|
1223
|
-
case 10:
|
1224
|
-
#line 132 "ragel/i18n/en_pirate.c.rl"
|
1225
|
-
{
|
1226
|
-
STORE_KW_END_CON(examples);
|
1227
|
-
}
|
1228
|
-
break;
|
1229
|
-
case 11:
|
1230
|
-
#line 136 "ragel/i18n/en_pirate.c.rl"
|
1231
|
-
{
|
1232
|
-
store_kw_con(listener, "step",
|
1233
|
-
PTR_TO(keyword_start), LEN(keyword_start, PTR_TO(keyword_end)),
|
1234
|
-
PTR_TO(content_start), LEN(content_start, p),
|
1235
|
-
lexer->current_line);
|
1236
|
-
}
|
1237
|
-
break;
|
1238
|
-
case 12:
|
1239
|
-
#line 143 "ragel/i18n/en_pirate.c.rl"
|
1240
|
-
{
|
1241
|
-
STORE_ATTR(comment);
|
1242
|
-
lexer->mark = 0;
|
1243
|
-
}
|
1244
|
-
break;
|
1245
|
-
case 13:
|
1246
|
-
#line 148 "ragel/i18n/en_pirate.c.rl"
|
1247
|
-
{
|
1248
|
-
STORE_ATTR(tag);
|
1249
|
-
lexer->mark = 0;
|
1250
|
-
}
|
1251
|
-
break;
|
1252
|
-
case 14:
|
1253
|
-
#line 153 "ragel/i18n/en_pirate.c.rl"
|
1254
|
-
{
|
1255
|
-
lexer->line_number += 1;
|
1256
|
-
MARK(final_newline, p);
|
1257
|
-
}
|
1258
|
-
break;
|
1259
|
-
case 15:
|
1260
|
-
#line 158 "ragel/i18n/en_pirate.c.rl"
|
1261
|
-
{
|
1262
|
-
MARK(last_newline, p + 1);
|
1263
|
-
}
|
1264
|
-
break;
|
1265
|
-
case 16:
|
1266
|
-
#line 162 "ragel/i18n/en_pirate.c.rl"
|
1267
|
-
{
|
1268
|
-
if (lexer->mark == 0) {
|
1269
|
-
MARK(mark, p);
|
1270
|
-
}
|
1271
|
-
}
|
1272
|
-
break;
|
1273
|
-
case 17:
|
1274
|
-
#line 168 "ragel/i18n/en_pirate.c.rl"
|
1275
|
-
{
|
1276
|
-
MARK(keyword_end, p);
|
1277
|
-
MARK(keyword_start, PTR_TO(mark));
|
1278
|
-
MARK(content_start, p + 1);
|
1279
|
-
lexer->mark = 0;
|
1280
|
-
}
|
1281
|
-
break;
|
1282
|
-
case 18:
|
1283
|
-
#line 175 "ragel/i18n/en_pirate.c.rl"
|
1284
|
-
{
|
1285
|
-
MARK(content_end, p);
|
1286
|
-
}
|
1287
|
-
break;
|
1288
|
-
case 19:
|
1289
|
-
#line 179 "ragel/i18n/en_pirate.c.rl"
|
1290
|
-
{
|
1291
|
-
p = p - 1;
|
1292
|
-
lexer->current_line = lexer->line_number;
|
1293
|
-
current_row = rb_ary_new();
|
1294
|
-
}
|
1295
|
-
break;
|
1296
|
-
case 20:
|
1297
|
-
#line 185 "ragel/i18n/en_pirate.c.rl"
|
1298
|
-
{
|
1299
|
-
MARK(content_start, p);
|
1300
|
-
}
|
1301
|
-
break;
|
1302
|
-
case 21:
|
1303
|
-
#line 189 "ragel/i18n/en_pirate.c.rl"
|
1304
|
-
{
|
1305
|
-
VALUE re_pipe, re_newline, re_backslash;
|
1306
|
-
VALUE con = ENCODED_STR_NEW(PTR_TO(content_start), LEN(content_start, p));
|
1307
|
-
rb_funcall(con, rb_intern("strip!"), 0);
|
1308
|
-
re_pipe = rb_reg_regcomp(rb_str_new2("\\\\\\|"));
|
1309
|
-
re_newline = rb_reg_regcomp(rb_str_new2("\\\\n"));
|
1310
|
-
re_backslash = rb_reg_regcomp(rb_str_new2("\\\\\\\\"));
|
1311
|
-
rb_funcall(con, rb_intern("gsub!"), 2, re_pipe, rb_str_new2("|"));
|
1312
|
-
rb_funcall(con, rb_intern("gsub!"), 2, re_newline, rb_str_new2("\n"));
|
1313
|
-
rb_funcall(con, rb_intern("gsub!"), 2, re_backslash, rb_str_new2("\\"));
|
1314
|
-
|
1315
|
-
rb_ary_push(current_row, con);
|
1316
|
-
}
|
1317
|
-
break;
|
1318
|
-
case 22:
|
1319
|
-
#line 203 "ragel/i18n/en_pirate.c.rl"
|
1320
|
-
{
|
1321
|
-
rb_funcall(listener, rb_intern("row"), 2, current_row, INT2FIX(lexer->current_line));
|
1322
|
-
}
|
1323
|
-
break;
|
1324
|
-
case 23:
|
1325
|
-
#line 207 "ragel/i18n/en_pirate.c.rl"
|
1326
|
-
{
|
1327
|
-
int line;
|
1328
|
-
if (cs < lexer_first_final) {
|
1329
|
-
size_t count = 0;
|
1330
|
-
VALUE newstr_val;
|
1331
|
-
char *newstr;
|
1332
|
-
int newstr_count = 0;
|
1333
|
-
size_t len;
|
1334
|
-
const char *buff;
|
1335
|
-
if (lexer->last_newline != 0) {
|
1336
|
-
len = LEN(last_newline, eof);
|
1337
|
-
buff = PTR_TO(last_newline);
|
1338
|
-
} else {
|
1339
|
-
len = strlen(data);
|
1340
|
-
buff = data;
|
1341
|
-
}
|
1342
|
-
|
1343
|
-
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1344
|
-
newstr_val = rb_str_new(buff, len);
|
1345
|
-
newstr = RSTRING_PTR(newstr_val);
|
1346
|
-
|
1347
|
-
|
1348
|
-
for (count = 0; count < len; count++) {
|
1349
|
-
if(buff[count] == 10) {
|
1350
|
-
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1351
|
-
break;
|
1352
|
-
} else {
|
1353
|
-
if (buff[count] == '%') {
|
1354
|
-
newstr[newstr_count++] = buff[count];
|
1355
|
-
newstr[newstr_count] = buff[count];
|
1356
|
-
} else {
|
1357
|
-
newstr[newstr_count] = buff[count];
|
1358
|
-
}
|
1359
|
-
}
|
1360
|
-
newstr_count++;
|
1361
|
-
}
|
1362
|
-
|
1363
|
-
line = lexer->line_number;
|
1364
|
-
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1365
|
-
raise_lexer_error(newstr, line);
|
1366
|
-
} else {
|
1367
|
-
rb_funcall(listener, rb_intern("eof"), 0);
|
1368
|
-
}
|
1369
|
-
}
|
1370
|
-
break;
|
1371
|
-
#line 1372 "ext/gherkin_lexer_en_pirate/gherkin_lexer_en_pirate.c"
|
1372
|
-
}
|
1373
|
-
}
|
1374
|
-
|
1375
|
-
_again:
|
1376
|
-
if ( cs == 0 )
|
1377
|
-
goto _out;
|
1378
|
-
if ( ++p != pe )
|
1379
|
-
goto _resume;
|
1380
|
-
_test_eof: {}
|
1381
|
-
if ( p == eof )
|
1382
|
-
{
|
1383
|
-
const char *__acts = _lexer_actions + _lexer_eof_actions[cs];
|
1384
|
-
unsigned int __nacts = (unsigned int) *__acts++;
|
1385
|
-
while ( __nacts-- > 0 ) {
|
1386
|
-
switch ( *__acts++ ) {
|
1387
|
-
case 23:
|
1388
|
-
#line 207 "ragel/i18n/en_pirate.c.rl"
|
1389
|
-
{
|
1390
|
-
int line;
|
1391
|
-
if (cs < lexer_first_final) {
|
1392
|
-
size_t count = 0;
|
1393
|
-
VALUE newstr_val;
|
1394
|
-
char *newstr;
|
1395
|
-
int newstr_count = 0;
|
1396
|
-
size_t len;
|
1397
|
-
const char *buff;
|
1398
|
-
if (lexer->last_newline != 0) {
|
1399
|
-
len = LEN(last_newline, eof);
|
1400
|
-
buff = PTR_TO(last_newline);
|
1401
|
-
} else {
|
1402
|
-
len = strlen(data);
|
1403
|
-
buff = data;
|
1404
|
-
}
|
1405
|
-
|
1406
|
-
/* Allocate as a ruby string so that it gets cleaned up by GC */
|
1407
|
-
newstr_val = rb_str_new(buff, len);
|
1408
|
-
newstr = RSTRING_PTR(newstr_val);
|
1409
|
-
|
1410
|
-
|
1411
|
-
for (count = 0; count < len; count++) {
|
1412
|
-
if(buff[count] == 10) {
|
1413
|
-
newstr[newstr_count] = '\0'; /* terminate new string at first newline found */
|
1414
|
-
break;
|
1415
|
-
} else {
|
1416
|
-
if (buff[count] == '%') {
|
1417
|
-
newstr[newstr_count++] = buff[count];
|
1418
|
-
newstr[newstr_count] = buff[count];
|
1419
|
-
} else {
|
1420
|
-
newstr[newstr_count] = buff[count];
|
1421
|
-
}
|
1422
|
-
}
|
1423
|
-
newstr_count++;
|
1424
|
-
}
|
1425
|
-
|
1426
|
-
line = lexer->line_number;
|
1427
|
-
lexer_init(lexer); /* Re-initialize so we can scan again with the same lexer */
|
1428
|
-
raise_lexer_error(newstr, line);
|
1429
|
-
} else {
|
1430
|
-
rb_funcall(listener, rb_intern("eof"), 0);
|
1431
|
-
}
|
1432
|
-
}
|
1433
|
-
break;
|
1434
|
-
#line 1435 "ext/gherkin_lexer_en_pirate/gherkin_lexer_en_pirate.c"
|
1435
|
-
}
|
1436
|
-
}
|
1437
|
-
}
|
1438
|
-
|
1439
|
-
_out: {}
|
1440
|
-
}
|
1441
|
-
|
1442
|
-
#line 426 "ragel/i18n/en_pirate.c.rl"
|
1443
|
-
|
1444
|
-
assert(p <= pe && "data overflow after parsing execute");
|
1445
|
-
assert(lexer->content_start <= len && "content starts after data end");
|
1446
|
-
assert(lexer->mark < len && "mark is after data end");
|
1447
|
-
|
1448
|
-
/* Reset lexer by re-initializing the whole thing */
|
1449
|
-
lexer_init(lexer);
|
1450
|
-
|
1451
|
-
if (cs == lexer_error) {
|
1452
|
-
rb_raise(rb_eGherkinLexingError, "Invalid format, lexing fails.");
|
1453
|
-
} else {
|
1454
|
-
return Qtrue;
|
1455
|
-
}
|
1456
|
-
}
|
1457
|
-
}
|
1458
|
-
|
1459
|
-
void Init_gherkin_lexer_en_pirate()
|
1460
|
-
{
|
1461
|
-
mGherkin = rb_define_module("Gherkin");
|
1462
|
-
mGherkinLexer = rb_define_module_under(mGherkin, "Lexer");
|
1463
|
-
rb_eGherkinLexingError = rb_const_get(mGherkinLexer, rb_intern("LexingError"));
|
1464
|
-
|
1465
|
-
mCLexer = rb_define_module_under(mGherkin, "CLexer");
|
1466
|
-
cI18nLexer = rb_define_class_under(mCLexer, "En_pirate", rb_cObject);
|
1467
|
-
rb_define_alloc_func(cI18nLexer, CLexer_alloc);
|
1468
|
-
rb_define_method(cI18nLexer, "initialize", CLexer_init, 1);
|
1469
|
-
rb_define_method(cI18nLexer, "scan", CLexer_scan, 1);
|
1470
|
-
}
|
1471
|
-
|