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