gherkin 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -5,3 +5,4 @@ rdoc
5
5
  pkg
6
6
  ext
7
7
  tmp
8
+ release
@@ -1,4 +1,15 @@
1
- == 1.0.5 (2009-04-08)
1
+ == 1.0.6 (2010-04-10)
2
+
3
+ === New Features
4
+ * Fully automated release process. (Aslak Hellesøy)
5
+
6
+ === Changed Features
7
+ * Made generated classes use a more uniform naming convention. (Aslak Hellesøy)
8
+
9
+ === Removed Features
10
+ * Removed C# port, obsoleted by IKVM build from 1.0.5. (Aslak Hellesøy)
11
+
12
+ == 1.0.5 (2010-04-08)
2
13
 
3
14
  === New Features
4
15
  * New .NET build of gherkin - an ikvmc build of gherkin.jar to gherkin.dll. (Aslak Hellesøy)
@@ -6,7 +17,7 @@
6
17
  === Bugfixes
7
18
  * Made parsers reusable so that the same instance can parse several features. (Aslak Hellesøy)
8
19
 
9
- == 1.0.4 (2009-04-07)
20
+ == 1.0.4 (2010-04-07)
10
21
 
11
22
  === New features
12
23
  * Pure java releases of Gherkin at http://cukes.info/maven
@@ -15,7 +26,7 @@
15
26
  === Changed features
16
27
  * The Lexer now emits the '@' for tags. (Aslak Hellesøy)
17
28
 
18
- == 1.0.3 (2009-03-31)
29
+ == 1.0.3 (2010-03-31)
19
30
 
20
31
  === Bugfixes
21
32
  * The C lexer correctly instantiates a new array for each table, instead of reusing the old one. (Aslak Hellesøy)
@@ -28,21 +28,10 @@ E.g. in Bash, export RL_LANG="en,fr,no". This can be quite helpful when modifyin
28
28
 
29
29
  == Release process
30
30
 
31
- * Bump version in the VERSION file
32
- * Do a file search and replace from old version number to new one.
33
- * Run "rake clean spec cucumber" for each platform (1.8.6, 1.8.7, 1.9, jruby) to make sure all is green.
34
- * rvm 1.8.7
35
- * rake clean jar compile
36
- * rake gemspec
37
- * git commit -a -m "Release vX.Y.Z"
38
- * rake gemcutter:release
39
- * rake git:release
40
- * ./nativegems.sh
41
- * gem push pkg/... (for each native gem)
42
- * cd java && mvn deploy
43
- * rake ikvm
44
- * Upload pkg/gherkin-X.Y.Z.dll to Github: http://github.com/aslakhellesoy/gherkin/downloads
45
-
31
+ * Bump version in the VERSION.yml file and:
32
+ ** java/pom.xml
33
+ ** ikvm/Gherkin/Gherkin,csproj
34
+ * rake release:ALL
46
35
  * Announce on Cucumber list, IRC and Twitter.
47
36
 
48
37
  == Configuring Rake-Compiler for cross compilation
data/Rakefile CHANGED
@@ -22,9 +22,7 @@ begin
22
22
  gem.add_development_dependency "rspec", ">= 1.3.0"
23
23
  gem.add_development_dependency "cucumber", ">= 0.6.4"
24
24
  gem.add_development_dependency "rake-compiler", ">= 0.7.0" unless defined?(JRUBY_VERSION)
25
- gem.add_development_dependency "albacore", ">= 0.1.2"
26
25
 
27
- gem.files -= FileList['dotnet/**/*']
28
26
  gem.files -= FileList['ikvm/**/*']
29
27
  gem.files -= FileList['java/**/*']
30
28
  case ENV['PLATFORM']
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 0
3
- :patch: 5
3
+ :patch: 6
4
4
  :major: 1
@@ -1,10 +1,8 @@
1
1
  module Gherkin
2
2
  module CLexer
3
- def self.[](i18n_language_name)
4
- name = i18n_language_name.gsub(/[\s-]/, '')
5
- require "gherkin_lexer_#{name}"
6
- i18n_lexer_class_name = name.capitalize
7
- const_get(i18n_lexer_class_name)
3
+ def self.[](i18n_sanitized_key)
4
+ require "gherkin_lexer_#{i18n_sanitized_key}"
5
+ const_get(i18n_sanitized_key.capitalize)
8
6
  end
9
7
  end
10
8
  end
@@ -65,16 +65,16 @@ module Gherkin
65
65
 
66
66
  def c(listener)
67
67
  require 'gherkin/c_lexer'
68
- CLexer[@key].new(listener)
68
+ CLexer[sanitized_key].new(listener)
69
69
  end
70
70
 
71
71
  def rb(listener)
72
72
  require 'gherkin/rb_lexer'
73
- RbLexer[@key].new(listener)
73
+ RbLexer[sanitized_key].new(listener)
74
74
  end
75
75
 
76
76
  def sanitized_key
77
- @key.gsub(/[\s-]/, '')
77
+ @key.gsub(/[\s-]/, '_').downcase
78
78
  end
79
79
 
80
80
  def incomplete?
@@ -495,6 +495,19 @@
495
495
  then: "*|O zaman"
496
496
  and: "*|Ve"
497
497
  but: "*|Fakat|Ama"
498
+ "uk":
499
+ name: Ukrainian
500
+ native: Українська
501
+ feature: Функціонал
502
+ background: Передумова
503
+ scenario: Сценарій
504
+ scenario_outline: Структура сценарію
505
+ examples: Приклади
506
+ given: "*|Припустимо|Припустимо, що|Нехай"
507
+ when: "*|Якщо"
508
+ then: "*|То"
509
+ and: "*|І"
510
+ but: "*|Але"
498
511
  "uz":
499
512
  name: Uzbek
500
513
  native: Узбекча
@@ -1,10 +1,8 @@
1
1
  module Gherkin
2
2
  module RbLexer
3
- def self.[](i18n_language_name)
4
- name = i18n_language_name.gsub(/[\s-]/, '')
5
- require "gherkin/rb_lexer/#{name}"
6
- i18n_lexer_class_name = name.capitalize
7
- const_get(i18n_lexer_class_name)
3
+ def self.[](i18n_sanitized_key)
4
+ require "gherkin/rb_lexer/#{i18n_sanitized_key}"
5
+ const_get(i18n_sanitized_key.capitalize)
8
6
  end
9
7
  end
10
8
  end
@@ -8,7 +8,7 @@ import gherkin.Lexer;
8
8
  import gherkin.Listener;
9
9
  import gherkin.LexingError;
10
10
 
11
- public class <%= @i18n.sanitized_key.capitalize %> implements Lexer {
11
+ public class <%= @i18n.sanitized_key.upcase %> implements Lexer {
12
12
  %%{
13
13
  machine lexer;
14
14
  alphtype byte;
@@ -134,7 +134,7 @@ public class <%= @i18n.sanitized_key.capitalize %> implements Lexer {
134
134
 
135
135
  private final Listener listener;
136
136
 
137
- public <%= @i18n.sanitized_key.capitalize %>(Listener listener) {
137
+ public <%= @i18n.sanitized_key.upcase %>(Listener listener) {
138
138
  this.listener = listener;
139
139
  }
140
140
 
@@ -8,10 +8,7 @@ CLEAN.include [
8
8
  'ragel/i18n/*.rl',
9
9
  'lib/gherkin/rb_lexer/*.rb',
10
10
  'ext/**/*.c',
11
- 'java/src/gherkin/lexer/*.java',
12
- 'dotnet/Gherkin/Lexer',
13
- 'dotnet/Gherkin/obj',
14
- 'dotnet/Gherkin/bin'
11
+ 'java/src/main/java/gherkin/lexer/*.java'
15
12
  ]
16
13
 
17
14
  desc "Compile the Java extensions"
@@ -21,83 +18,14 @@ file 'lib/gherkin.jar' => Dir['java/src/main/java/**/*.java'] do
21
18
  sh("mvn -f java/pom.xml package")
22
19
  end
23
20
 
24
- namespace :dotnet do
25
- require 'albacore'
26
-
27
- FileList['lib/gherkin/parser/*'].each do |src|
28
- dst = "dotnet/Gherkin/StateMachine/#{File.basename(src)}"
29
- file dst => src do
30
- cp src, dst, :verbose => true
31
- end
32
- task :compile => dst
33
- end
34
-
35
- task :compile => :lexer
36
-
37
- if (`which mono` rescue "") =~ /mono/
38
- xbuild :compile do |msb|
39
- msb.properties :configuration => :Release
40
- msb.targets :Build
41
- msb.solution = 'dotnet/Gherkin.sln'
42
- end
43
-
44
- require 'rake/xunittask'
45
- class XUnitTestRunner
46
- def execute
47
- system("mono dotnet/lib/xunit/xunit.console.exe dotnet/Gherkin.Tests/bin/Release/Gherkin.Tests.dll")
48
- exit 1 if $? != 0
49
- end
50
- end
51
- else
52
- msbuild :compile do |msb|
53
- msb.properties :configuration => :Release
54
- msb.targets :Build
55
- msb.solution = 'dotnet/Gherkin.sln'
56
- end
57
- end
58
-
59
- xunit :test => :compile do |xunit|
60
- xunit.path_to_command = "dotnet/lib/xunit/xunit.console.exe"
61
- xunit.assembly = "dotnet/Gherkin.Tests/bin/Release/Gherkin.Tests.dll"
62
- end
63
-
64
- task :package => :test do
65
- cp 'dotnet/Gherkin/bin/Release/Gherkin.dll', 'lib/Gherkin.dll'
66
- end
67
- end
68
-
69
- desc "Compile and package the .NET extensions"
70
- task :dotnet => ['dotnet:package']
71
-
72
- class CSharpSByteFixTask
73
- def initialize(source)
74
- @source = source
75
- define_tasks
76
- end
77
-
78
- def define_tasks
79
- directory File.dirname(target)
80
- file target => [File.dirname(target), @source] do
81
- sh "cat #{@source} | sed ""s/sbyte/short/g"" > #{target}"
82
- end
83
- end
84
-
85
- def target
86
- "dotnet/Gherkin/Lexer/#{File.basename(@source)}"
87
- end
88
- end
89
-
90
21
  rl_langs = ENV['RL_LANGS'] ? ENV['RL_LANGS'].split(',') : []
91
22
  langs = Gherkin::I18n.all.select { |lang| rl_langs.empty? || rl_langs.include?(lang.key) }
92
23
 
93
24
  langs.each do |i18n|
94
25
  java = RagelTask.new('java', i18n)
95
26
  rb = RagelTask.new('rb', i18n)
96
- csharp_tmp = RagelTask.new('csharp', i18n)
97
- csharp = CSharpSByteFixTask.new(csharp_tmp.target)
98
27
 
99
- task :jar => [java.target, rb.target]
100
- task 'dotnet:lexer' => csharp.target
28
+ file 'lib/gherkin.jar' => [java.target, rb.target]
101
29
 
102
30
  begin
103
31
  unless defined?(JRUBY_VERSION)
@@ -0,0 +1,31 @@
1
+ namespace :gems do
2
+ desc 'Release JRuby gem'
3
+ task :jruby => :release_dir do
4
+ sh "rvm jruby rake clean spec gemspec build PLATFORM=java"
5
+ mv "pkg/gherkin-#{GHERKIN_VERSION}-java.gem", 'release'
6
+ end
7
+
8
+ desc "Release MRI/C POSIX gem"
9
+ task :posix => :release_dir do
10
+ sh "rvm 1.8.7 rake clean spec gemspec build"
11
+ mv "pkg/gherkin-#{GHERKIN_VERSION}.gem", 'release'
12
+ end
13
+
14
+ [:mswin32, :mingw32].each do |win_compiler|
15
+ desc "Release MRI/C precompiled #{win_compiler} gem"
16
+ task win_compiler => :posix do
17
+ sh "rvm 1.8.7 rake cross compile gemspec build PLATFORM=i386-#{win_compiler} RUBY_CC_VERSION=1.8.6"
18
+ mv "pkg/gherkin-#{GHERKIN_VERSION}-x86-#{win_compiler}.gem", 'release'
19
+ end
20
+ end
21
+
22
+ task :release_dir do
23
+ mkdir 'release' unless File.directory?('release')
24
+ end
25
+
26
+ task :clean_release_dir do
27
+ rm_rf 'release' if File.directory?('release')
28
+ end
29
+ end
30
+
31
+ task :gems => ['gems:clean_release_dir', 'gems:jruby', 'gems:posix', 'gems:mswin32', 'gems:mingw32']
@@ -26,19 +26,19 @@ namespace :ikvm do
26
26
  task :dll => 'pkg/gherkin.dll'
27
27
 
28
28
  file 'pkg/gherkin.exe' => 'lib/gherkin.jar' do
29
- mkdir_p 'pkg' unless File.directory?('pkg')
30
- sh("mono /usr/local/ikvm/bin/ikvmc.exe -target:exe lib/gherkin.jar -out:pkg/gherkin-#{GHERKIN_VERSION}.exe")
29
+ mkdir_p 'release' unless File.directory?('release')
30
+ sh("mono /usr/local/ikvm/bin/ikvmc.exe -target:exe lib/gherkin.jar -out:release/gherkin-#{GHERKIN_VERSION}.exe")
31
31
  end
32
32
 
33
33
  file 'pkg/gherkin.dll' => 'lib/gherkin.jar' do
34
- mkdir_p 'pkg' unless File.directory?('pkg')
35
- sh("mono /usr/local/ikvm/bin/ikvmc.exe -target:library lib/gherkin.jar -out:pkg/gherkin-#{GHERKIN_VERSION}.dll")
34
+ mkdir_p 'release' unless File.directory?('release')
35
+ sh("mono /usr/local/ikvm/bin/ikvmc.exe -target:library lib/gherkin.jar -out:release/gherkin-#{GHERKIN_VERSION}.dll")
36
36
  end
37
37
 
38
38
  desc 'Copy the IKVM .dll files over to the pkg dir'
39
39
  task :copy_ikvm_dlls do
40
40
  Dir['/usr/local/ikvm/bin/{IKVM.OpenJDK.Core,IKVM.OpenJDK.Text,IKVM.Runtime}.dll'].each do |dll|
41
- cp dll, 'pkg'
41
+ cp dll, 'release'
42
42
  end
43
43
  end
44
44
  end
@@ -28,7 +28,7 @@ class RagelTask
28
28
  def target
29
29
  {
30
30
  'c' => "ext/gherkin_lexer_#{@i18n.sanitized_key}/gherkin_lexer_#{@i18n.sanitized_key}.c",
31
- 'java' => "java/src/main/java/gherkin/lexer/#{@i18n.sanitized_key.capitalize}.java",
31
+ 'java' => "java/src/main/java/gherkin/lexer/#{@i18n.sanitized_key.upcase}.java",
32
32
  'rb' => "lib/gherkin/rb_lexer/#{@i18n.sanitized_key}.rb",
33
33
  'csharp' => "tmp/#{@i18n.sanitized_key}.cs"
34
34
  }[@lang]
@@ -0,0 +1,26 @@
1
+ namespace :release do
2
+ desc 'Uplad all packages and tag git'
3
+ task :ALL => [:_gems, :dll, :jar, 'git:release']
4
+
5
+ task :_gems => :gems do
6
+ Dir.chdir('release') do
7
+ Dir['*.gem'].each do |gem_file|
8
+ sh("gem push #{gem_file}")
9
+ end
10
+ end
11
+ end
12
+
13
+ task :dll => :ikvm do
14
+ Dir.chdir('release') do
15
+ # This requires aslakhellesoy's build of the github gem,
16
+ # which has tekkub's upload command.
17
+ sh("github upload #{Dir['gherkin*.dll'][0]}")
18
+ end
19
+ end
20
+
21
+ task :jar do
22
+ Dir.chdir('java') do
23
+ sh("mvn deploy")
24
+ end
25
+ end
26
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 5
9
- version: 1.0.5
8
+ - 6
9
+ version: 1.0.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mike Sassak
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-04-08 00:00:00 +02:00
19
+ date: 2010-04-10 00:00:00 +02:00
20
20
  default_executable: gherkin
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -74,66 +74,12 @@ dependencies:
74
74
  version: 0.7.0
75
75
  type: :development
76
76
  version_requirements: *id004
77
- - !ruby/object:Gem::Dependency
78
- name: albacore
79
- prerelease: false
80
- requirement: &id005 !ruby/object:Gem::Requirement
81
- requirements:
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- segments:
85
- - 0
86
- - 1
87
- - 2
88
- version: 0.1.2
89
- type: :development
90
- version_requirements: *id005
91
77
  description: A fast Gherkin lexer/parser based on the Ragel State Machine Compiler.
92
78
  email: cukes@googlegroups.com
93
79
  executables:
94
80
  - gherkin
95
- extensions:
96
- - ext/gherkin_lexer_ar/extconf.rb
97
- - ext/gherkin_lexer_bg/extconf.rb
98
- - ext/gherkin_lexer_ca/extconf.rb
99
- - ext/gherkin_lexer_cs/extconf.rb
100
- - ext/gherkin_lexer_cyGB/extconf.rb
101
- - ext/gherkin_lexer_da/extconf.rb
102
- - ext/gherkin_lexer_de/extconf.rb
103
- - ext/gherkin_lexer_en/extconf.rb
104
- - ext/gherkin_lexer_enau/extconf.rb
105
- - ext/gherkin_lexer_enlol/extconf.rb
106
- - ext/gherkin_lexer_enScouse/extconf.rb
107
- - ext/gherkin_lexer_entx/extconf.rb
108
- - ext/gherkin_lexer_es/extconf.rb
109
- - ext/gherkin_lexer_et/extconf.rb
110
- - ext/gherkin_lexer_fi/extconf.rb
111
- - ext/gherkin_lexer_fr/extconf.rb
112
- - ext/gherkin_lexer_he/extconf.rb
113
- - ext/gherkin_lexer_hr/extconf.rb
114
- - ext/gherkin_lexer_hu/extconf.rb
115
- - ext/gherkin_lexer_id/extconf.rb
116
- - ext/gherkin_lexer_it/extconf.rb
117
- - ext/gherkin_lexer_ja/extconf.rb
118
- - ext/gherkin_lexer_ko/extconf.rb
119
- - ext/gherkin_lexer_lt/extconf.rb
120
- - ext/gherkin_lexer_lv/extconf.rb
121
- - ext/gherkin_lexer_nl/extconf.rb
122
- - ext/gherkin_lexer_no/extconf.rb
123
- - ext/gherkin_lexer_pl/extconf.rb
124
- - ext/gherkin_lexer_pt/extconf.rb
125
- - ext/gherkin_lexer_ro/extconf.rb
126
- - ext/gherkin_lexer_roRO/extconf.rb
127
- - ext/gherkin_lexer_ru/extconf.rb
128
- - ext/gherkin_lexer_sk/extconf.rb
129
- - ext/gherkin_lexer_srCyrl/extconf.rb
130
- - ext/gherkin_lexer_srLatn/extconf.rb
131
- - ext/gherkin_lexer_sv/extconf.rb
132
- - ext/gherkin_lexer_tr/extconf.rb
133
- - ext/gherkin_lexer_uz/extconf.rb
134
- - ext/gherkin_lexer_vi/extconf.rb
135
- - ext/gherkin_lexer_zhCN/extconf.rb
136
- - ext/gherkin_lexer_zhTW/extconf.rb
81
+ extensions: []
82
+
137
83
  extra_rdoc_files:
138
84
  - LICENSE
139
85
  - README.rdoc
@@ -148,48 +94,6 @@ files:
148
94
  - VERSION.yml
149
95
  - bin/gherkin
150
96
  - cucumber.yml
151
- - dotnet/.gitignore
152
- - ext/gherkin_lexer_ar/gherkin_lexer_ar.c
153
- - ext/gherkin_lexer_bg/gherkin_lexer_bg.c
154
- - ext/gherkin_lexer_ca/gherkin_lexer_ca.c
155
- - ext/gherkin_lexer_cs/gherkin_lexer_cs.c
156
- - ext/gherkin_lexer_cyGB/gherkin_lexer_cyGB.c
157
- - ext/gherkin_lexer_da/gherkin_lexer_da.c
158
- - ext/gherkin_lexer_de/gherkin_lexer_de.c
159
- - ext/gherkin_lexer_en/gherkin_lexer_en.c
160
- - ext/gherkin_lexer_enScouse/gherkin_lexer_enScouse.c
161
- - ext/gherkin_lexer_enau/gherkin_lexer_enau.c
162
- - ext/gherkin_lexer_enlol/gherkin_lexer_enlol.c
163
- - ext/gherkin_lexer_entx/gherkin_lexer_entx.c
164
- - ext/gherkin_lexer_es/gherkin_lexer_es.c
165
- - ext/gherkin_lexer_et/gherkin_lexer_et.c
166
- - ext/gherkin_lexer_fi/gherkin_lexer_fi.c
167
- - ext/gherkin_lexer_fr/gherkin_lexer_fr.c
168
- - ext/gherkin_lexer_he/gherkin_lexer_he.c
169
- - ext/gherkin_lexer_hr/gherkin_lexer_hr.c
170
- - ext/gherkin_lexer_hu/gherkin_lexer_hu.c
171
- - ext/gherkin_lexer_id/gherkin_lexer_id.c
172
- - ext/gherkin_lexer_it/gherkin_lexer_it.c
173
- - ext/gherkin_lexer_ja/gherkin_lexer_ja.c
174
- - ext/gherkin_lexer_ko/gherkin_lexer_ko.c
175
- - ext/gherkin_lexer_lt/gherkin_lexer_lt.c
176
- - ext/gherkin_lexer_lv/gherkin_lexer_lv.c
177
- - ext/gherkin_lexer_nl/gherkin_lexer_nl.c
178
- - ext/gherkin_lexer_no/gherkin_lexer_no.c
179
- - ext/gherkin_lexer_pl/gherkin_lexer_pl.c
180
- - ext/gherkin_lexer_pt/gherkin_lexer_pt.c
181
- - ext/gherkin_lexer_ro/gherkin_lexer_ro.c
182
- - ext/gherkin_lexer_roRO/gherkin_lexer_roRO.c
183
- - ext/gherkin_lexer_ru/gherkin_lexer_ru.c
184
- - ext/gherkin_lexer_sk/gherkin_lexer_sk.c
185
- - ext/gherkin_lexer_srCyrl/gherkin_lexer_srCyrl.c
186
- - ext/gherkin_lexer_srLatn/gherkin_lexer_srLatn.c
187
- - ext/gherkin_lexer_sv/gherkin_lexer_sv.c
188
- - ext/gherkin_lexer_tr/gherkin_lexer_tr.c
189
- - ext/gherkin_lexer_uz/gherkin_lexer_uz.c
190
- - ext/gherkin_lexer_vi/gherkin_lexer_vi.c
191
- - ext/gherkin_lexer_zhCN/gherkin_lexer_zhCN.c
192
- - ext/gherkin_lexer_zhTW/gherkin_lexer_zhTW.c
193
97
  - features/feature_parser.feature
194
98
  - features/native_lexer.feature
195
99
  - features/parser_with_native_lexer.feature
@@ -198,10 +102,8 @@ files:
198
102
  - features/step_definitions/pretty_listener_step.rb
199
103
  - features/steps_parser.feature
200
104
  - features/support/env.rb
201
- - gherkin.gemspec
202
105
  - ikvm/.gitignore
203
106
  - java/.gitignore
204
- - java/Gherkin.iml
205
107
  - java/src/main/java/gherkin/lexer/.gitignore
206
108
  - lib/.gitignore
207
109
  - lib/gherkin.rb
@@ -230,14 +132,14 @@ files:
230
132
  - lib/gherkin/rb_lexer/bg.rb
231
133
  - lib/gherkin/rb_lexer/ca.rb
232
134
  - lib/gherkin/rb_lexer/cs.rb
233
- - lib/gherkin/rb_lexer/cyGB.rb
135
+ - lib/gherkin/rb_lexer/cy_gb.rb
234
136
  - lib/gherkin/rb_lexer/da.rb
235
137
  - lib/gherkin/rb_lexer/de.rb
236
138
  - lib/gherkin/rb_lexer/en.rb
237
- - lib/gherkin/rb_lexer/enScouse.rb
238
- - lib/gherkin/rb_lexer/enau.rb
239
- - lib/gherkin/rb_lexer/enlol.rb
240
- - lib/gherkin/rb_lexer/entx.rb
139
+ - lib/gherkin/rb_lexer/en_au.rb
140
+ - lib/gherkin/rb_lexer/en_lol.rb
141
+ - lib/gherkin/rb_lexer/en_scouse.rb
142
+ - lib/gherkin/rb_lexer/en_tx.rb
241
143
  - lib/gherkin/rb_lexer/es.rb
242
144
  - lib/gherkin/rb_lexer/et.rb
243
145
  - lib/gherkin/rb_lexer/fi.rb
@@ -256,17 +158,18 @@ files:
256
158
  - lib/gherkin/rb_lexer/pl.rb
257
159
  - lib/gherkin/rb_lexer/pt.rb
258
160
  - lib/gherkin/rb_lexer/ro.rb
259
- - lib/gherkin/rb_lexer/roRO.rb
161
+ - lib/gherkin/rb_lexer/ro_ro.rb
260
162
  - lib/gherkin/rb_lexer/ru.rb
261
163
  - lib/gherkin/rb_lexer/sk.rb
262
- - lib/gherkin/rb_lexer/srCyrl.rb
263
- - lib/gherkin/rb_lexer/srLatn.rb
164
+ - lib/gherkin/rb_lexer/sr_cyrl.rb
165
+ - lib/gherkin/rb_lexer/sr_latn.rb
264
166
  - lib/gherkin/rb_lexer/sv.rb
265
167
  - lib/gherkin/rb_lexer/tr.rb
168
+ - lib/gherkin/rb_lexer/uk.rb
266
169
  - lib/gherkin/rb_lexer/uz.rb
267
170
  - lib/gherkin/rb_lexer/vi.rb
268
- - lib/gherkin/rb_lexer/zhCN.rb
269
- - lib/gherkin/rb_lexer/zhTW.rb
171
+ - lib/gherkin/rb_lexer/zh_cn.rb
172
+ - lib/gherkin/rb_lexer/zh_tw.rb
270
173
  - lib/gherkin/tools.rb
271
174
  - lib/gherkin/tools/files.rb
272
175
  - lib/gherkin/tools/reformat.rb
@@ -275,7 +178,6 @@ files:
275
178
  - nativegems.sh
276
179
  - ragel/i18n/.gitignore
277
180
  - ragel/lexer.c.rl.erb
278
- - ragel/lexer.csharp.rl.erb
279
181
  - ragel/lexer.java.rl.erb
280
182
  - ragel/lexer.rb.rl.erb
281
183
  - ragel/lexer_common.rl.erb
@@ -313,9 +215,11 @@ files:
313
215
  - tasks/bench/null_listener.rb
314
216
  - tasks/compile.rake
315
217
  - tasks/cucumber.rake
218
+ - tasks/gems.rake
316
219
  - tasks/ikvm.rake
317
220
  - tasks/ragel_task.rb
318
221
  - tasks/rdoc.rake
222
+ - tasks/release.rake
319
223
  - tasks/rspec.rake
320
224
  has_rdoc: true
321
225
  homepage: http://github.com/aslakhellesoy/gherkin
@@ -1,13 +0,0 @@
1
- *.user
2
- *.suo
3
- bin
4
- obj
5
- Gherkin/StateMachine/meta.txt
6
- Gherkin/StateMachine/root.txt
7
- Gherkin/StateMachine/steps.txt
8
- Gherkin/Lexer/*.cs
9
- *.sln.cache
10
- _ReSharper*
11
- Gherkin.sln.proj
12
- *.pidb
13
- *.userprefs
@@ -1,254 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{gherkin}
8
- s.version = "1.0.5"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Mike Sassak", "Gregory Hnatiuk", "Aslak Helles\303\270y"]
12
- s.date = %q{2010-04-08}
13
- s.default_executable = %q{gherkin}
14
- s.description = %q{A fast Gherkin lexer/parser based on the Ragel State Machine Compiler.}
15
- s.email = %q{cukes@googlegroups.com}
16
- s.executables = ["gherkin"]
17
- s.extensions = ["ext/gherkin_lexer_ar/extconf.rb", "ext/gherkin_lexer_bg/extconf.rb", "ext/gherkin_lexer_ca/extconf.rb", "ext/gherkin_lexer_cs/extconf.rb", "ext/gherkin_lexer_cyGB/extconf.rb", "ext/gherkin_lexer_da/extconf.rb", "ext/gherkin_lexer_de/extconf.rb", "ext/gherkin_lexer_en/extconf.rb", "ext/gherkin_lexer_enau/extconf.rb", "ext/gherkin_lexer_enlol/extconf.rb", "ext/gherkin_lexer_enScouse/extconf.rb", "ext/gherkin_lexer_entx/extconf.rb", "ext/gherkin_lexer_es/extconf.rb", "ext/gherkin_lexer_et/extconf.rb", "ext/gherkin_lexer_fi/extconf.rb", "ext/gherkin_lexer_fr/extconf.rb", "ext/gherkin_lexer_he/extconf.rb", "ext/gherkin_lexer_hr/extconf.rb", "ext/gherkin_lexer_hu/extconf.rb", "ext/gherkin_lexer_id/extconf.rb", "ext/gherkin_lexer_it/extconf.rb", "ext/gherkin_lexer_ja/extconf.rb", "ext/gherkin_lexer_ko/extconf.rb", "ext/gherkin_lexer_lt/extconf.rb", "ext/gherkin_lexer_lv/extconf.rb", "ext/gherkin_lexer_nl/extconf.rb", "ext/gherkin_lexer_no/extconf.rb", "ext/gherkin_lexer_pl/extconf.rb", "ext/gherkin_lexer_pt/extconf.rb", "ext/gherkin_lexer_ro/extconf.rb", "ext/gherkin_lexer_roRO/extconf.rb", "ext/gherkin_lexer_ru/extconf.rb", "ext/gherkin_lexer_sk/extconf.rb", "ext/gherkin_lexer_srCyrl/extconf.rb", "ext/gherkin_lexer_srLatn/extconf.rb", "ext/gherkin_lexer_sv/extconf.rb", "ext/gherkin_lexer_tr/extconf.rb", "ext/gherkin_lexer_uz/extconf.rb", "ext/gherkin_lexer_vi/extconf.rb", "ext/gherkin_lexer_zhCN/extconf.rb", "ext/gherkin_lexer_zhTW/extconf.rb"]
18
- s.extra_rdoc_files = [
19
- "LICENSE",
20
- "README.rdoc"
21
- ]
22
- s.files = [
23
- ".gitattributes",
24
- ".gitignore",
25
- ".mailmap",
26
- "History.txt",
27
- "LICENSE",
28
- "README.rdoc",
29
- "Rakefile",
30
- "VERSION.yml",
31
- "bin/gherkin",
32
- "cucumber.yml",
33
- "dotnet/.gitignore",
34
- "ext/gherkin_lexer_ar/gherkin_lexer_ar.c",
35
- "ext/gherkin_lexer_bg/gherkin_lexer_bg.c",
36
- "ext/gherkin_lexer_ca/gherkin_lexer_ca.c",
37
- "ext/gherkin_lexer_cs/gherkin_lexer_cs.c",
38
- "ext/gherkin_lexer_cyGB/gherkin_lexer_cyGB.c",
39
- "ext/gherkin_lexer_da/gherkin_lexer_da.c",
40
- "ext/gherkin_lexer_de/gherkin_lexer_de.c",
41
- "ext/gherkin_lexer_en/gherkin_lexer_en.c",
42
- "ext/gherkin_lexer_enScouse/gherkin_lexer_enScouse.c",
43
- "ext/gherkin_lexer_enau/gherkin_lexer_enau.c",
44
- "ext/gherkin_lexer_enlol/gherkin_lexer_enlol.c",
45
- "ext/gherkin_lexer_entx/gherkin_lexer_entx.c",
46
- "ext/gherkin_lexer_es/gherkin_lexer_es.c",
47
- "ext/gherkin_lexer_et/gherkin_lexer_et.c",
48
- "ext/gherkin_lexer_fi/gherkin_lexer_fi.c",
49
- "ext/gherkin_lexer_fr/gherkin_lexer_fr.c",
50
- "ext/gherkin_lexer_he/gherkin_lexer_he.c",
51
- "ext/gherkin_lexer_hr/gherkin_lexer_hr.c",
52
- "ext/gherkin_lexer_hu/gherkin_lexer_hu.c",
53
- "ext/gherkin_lexer_id/gherkin_lexer_id.c",
54
- "ext/gherkin_lexer_it/gherkin_lexer_it.c",
55
- "ext/gherkin_lexer_ja/gherkin_lexer_ja.c",
56
- "ext/gherkin_lexer_ko/gherkin_lexer_ko.c",
57
- "ext/gherkin_lexer_lt/gherkin_lexer_lt.c",
58
- "ext/gherkin_lexer_lv/gherkin_lexer_lv.c",
59
- "ext/gherkin_lexer_nl/gherkin_lexer_nl.c",
60
- "ext/gherkin_lexer_no/gherkin_lexer_no.c",
61
- "ext/gherkin_lexer_pl/gherkin_lexer_pl.c",
62
- "ext/gherkin_lexer_pt/gherkin_lexer_pt.c",
63
- "ext/gherkin_lexer_ro/gherkin_lexer_ro.c",
64
- "ext/gherkin_lexer_roRO/gherkin_lexer_roRO.c",
65
- "ext/gherkin_lexer_ru/gherkin_lexer_ru.c",
66
- "ext/gherkin_lexer_sk/gherkin_lexer_sk.c",
67
- "ext/gherkin_lexer_srCyrl/gherkin_lexer_srCyrl.c",
68
- "ext/gherkin_lexer_srLatn/gherkin_lexer_srLatn.c",
69
- "ext/gherkin_lexer_sv/gherkin_lexer_sv.c",
70
- "ext/gherkin_lexer_tr/gherkin_lexer_tr.c",
71
- "ext/gherkin_lexer_uz/gherkin_lexer_uz.c",
72
- "ext/gherkin_lexer_vi/gherkin_lexer_vi.c",
73
- "ext/gherkin_lexer_zhCN/gherkin_lexer_zhCN.c",
74
- "ext/gherkin_lexer_zhTW/gherkin_lexer_zhTW.c",
75
- "features/feature_parser.feature",
76
- "features/native_lexer.feature",
77
- "features/parser_with_native_lexer.feature",
78
- "features/pretty_printer.feature",
79
- "features/step_definitions/gherkin_steps.rb",
80
- "features/step_definitions/pretty_listener_step.rb",
81
- "features/steps_parser.feature",
82
- "features/support/env.rb",
83
- "gherkin.gemspec",
84
- "ikvm/.gitignore",
85
- "java/.gitignore",
86
- "java/Gherkin.iml",
87
- "java/src/main/java/gherkin/lexer/.gitignore",
88
- "lib/.gitignore",
89
- "lib/gherkin.rb",
90
- "lib/gherkin/c_lexer.rb",
91
- "lib/gherkin/cli/main.rb",
92
- "lib/gherkin/core_ext/array.rb",
93
- "lib/gherkin/csharp_lexer.rb",
94
- "lib/gherkin/formatter/argument.rb",
95
- "lib/gherkin/formatter/colors.rb",
96
- "lib/gherkin/formatter/monochrome_format.rb",
97
- "lib/gherkin/formatter/pretty_listener.rb",
98
- "lib/gherkin/i18n.rb",
99
- "lib/gherkin/i18n.yml",
100
- "lib/gherkin/i18n_lexer.rb",
101
- "lib/gherkin/parser/filter_listener.rb",
102
- "lib/gherkin/parser/meta.txt",
103
- "lib/gherkin/parser/parser.rb",
104
- "lib/gherkin/parser/root.txt",
105
- "lib/gherkin/parser/sexp.rb",
106
- "lib/gherkin/parser/steps.txt",
107
- "lib/gherkin/parser/tag_expression.rb",
108
- "lib/gherkin/rb_lexer.rb",
109
- "lib/gherkin/rb_lexer/.gitignore",
110
- "lib/gherkin/rb_lexer/README.rdoc",
111
- "lib/gherkin/rb_lexer/ar.rb",
112
- "lib/gherkin/rb_lexer/bg.rb",
113
- "lib/gherkin/rb_lexer/ca.rb",
114
- "lib/gherkin/rb_lexer/cs.rb",
115
- "lib/gherkin/rb_lexer/cyGB.rb",
116
- "lib/gherkin/rb_lexer/da.rb",
117
- "lib/gherkin/rb_lexer/de.rb",
118
- "lib/gherkin/rb_lexer/en.rb",
119
- "lib/gherkin/rb_lexer/enScouse.rb",
120
- "lib/gherkin/rb_lexer/enau.rb",
121
- "lib/gherkin/rb_lexer/enlol.rb",
122
- "lib/gherkin/rb_lexer/entx.rb",
123
- "lib/gherkin/rb_lexer/es.rb",
124
- "lib/gherkin/rb_lexer/et.rb",
125
- "lib/gherkin/rb_lexer/fi.rb",
126
- "lib/gherkin/rb_lexer/fr.rb",
127
- "lib/gherkin/rb_lexer/he.rb",
128
- "lib/gherkin/rb_lexer/hr.rb",
129
- "lib/gherkin/rb_lexer/hu.rb",
130
- "lib/gherkin/rb_lexer/id.rb",
131
- "lib/gherkin/rb_lexer/it.rb",
132
- "lib/gherkin/rb_lexer/ja.rb",
133
- "lib/gherkin/rb_lexer/ko.rb",
134
- "lib/gherkin/rb_lexer/lt.rb",
135
- "lib/gherkin/rb_lexer/lv.rb",
136
- "lib/gherkin/rb_lexer/nl.rb",
137
- "lib/gherkin/rb_lexer/no.rb",
138
- "lib/gherkin/rb_lexer/pl.rb",
139
- "lib/gherkin/rb_lexer/pt.rb",
140
- "lib/gherkin/rb_lexer/ro.rb",
141
- "lib/gherkin/rb_lexer/roRO.rb",
142
- "lib/gherkin/rb_lexer/ru.rb",
143
- "lib/gherkin/rb_lexer/sk.rb",
144
- "lib/gherkin/rb_lexer/srCyrl.rb",
145
- "lib/gherkin/rb_lexer/srLatn.rb",
146
- "lib/gherkin/rb_lexer/sv.rb",
147
- "lib/gherkin/rb_lexer/tr.rb",
148
- "lib/gherkin/rb_lexer/uz.rb",
149
- "lib/gherkin/rb_lexer/vi.rb",
150
- "lib/gherkin/rb_lexer/zhCN.rb",
151
- "lib/gherkin/rb_lexer/zhTW.rb",
152
- "lib/gherkin/tools.rb",
153
- "lib/gherkin/tools/files.rb",
154
- "lib/gherkin/tools/reformat.rb",
155
- "lib/gherkin/tools/stats.rb",
156
- "lib/gherkin/tools/stats_listener.rb",
157
- "nativegems.sh",
158
- "ragel/i18n/.gitignore",
159
- "ragel/lexer.c.rl.erb",
160
- "ragel/lexer.csharp.rl.erb",
161
- "ragel/lexer.java.rl.erb",
162
- "ragel/lexer.rb.rl.erb",
163
- "ragel/lexer_common.rl.erb",
164
- "spec/gherkin/c_lexer_spec.rb",
165
- "spec/gherkin/csharp_lexer_spec.rb",
166
- "spec/gherkin/fixtures/1.feature",
167
- "spec/gherkin/fixtures/comments_in_table.feature",
168
- "spec/gherkin/fixtures/complex.feature",
169
- "spec/gherkin/fixtures/dos_line_endings.feature",
170
- "spec/gherkin/fixtures/i18n_fr.feature",
171
- "spec/gherkin/fixtures/i18n_no.feature",
172
- "spec/gherkin/fixtures/i18n_zh-CN.feature",
173
- "spec/gherkin/fixtures/simple.feature",
174
- "spec/gherkin/fixtures/simple_with_comments.feature",
175
- "spec/gherkin/fixtures/simple_with_tags.feature",
176
- "spec/gherkin/formatter/argument_spec.rb",
177
- "spec/gherkin/formatter/colors_spec.rb",
178
- "spec/gherkin/formatter/pretty_listener_spec.rb",
179
- "spec/gherkin/i18n_lexer_spec.rb",
180
- "spec/gherkin/i18n_spec.rb",
181
- "spec/gherkin/java_lexer_spec.rb",
182
- "spec/gherkin/parser/filter_listener_spec.rb",
183
- "spec/gherkin/parser/parser_spec.rb",
184
- "spec/gherkin/parser/tag_expression_spec.rb",
185
- "spec/gherkin/rb_lexer_spec.rb",
186
- "spec/gherkin/sexp_recorder.rb",
187
- "spec/gherkin/shared/lexer_spec.rb",
188
- "spec/gherkin/shared/py_string_spec.rb",
189
- "spec/gherkin/shared/row_spec.rb",
190
- "spec/gherkin/shared/tags_spec.rb",
191
- "spec/spec_helper.rb",
192
- "tasks/bench.rake",
193
- "tasks/bench/feature_builder.rb",
194
- "tasks/bench/generated/.gitignore",
195
- "tasks/bench/null_listener.rb",
196
- "tasks/compile.rake",
197
- "tasks/cucumber.rake",
198
- "tasks/ikvm.rake",
199
- "tasks/ragel_task.rb",
200
- "tasks/rdoc.rake",
201
- "tasks/rspec.rake"
202
- ]
203
- s.homepage = %q{http://github.com/aslakhellesoy/gherkin}
204
- s.rdoc_options = ["--charset=UTF-8"]
205
- s.require_paths = ["lib"]
206
- s.rubygems_version = %q{1.3.6}
207
- s.summary = %q{Fast Gherkin lexer/parser}
208
- s.test_files = [
209
- "spec/gherkin/c_lexer_spec.rb",
210
- "spec/gherkin/csharp_lexer_spec.rb",
211
- "spec/gherkin/formatter/argument_spec.rb",
212
- "spec/gherkin/formatter/colors_spec.rb",
213
- "spec/gherkin/formatter/pretty_listener_spec.rb",
214
- "spec/gherkin/i18n_lexer_spec.rb",
215
- "spec/gherkin/i18n_spec.rb",
216
- "spec/gherkin/java_lexer_spec.rb",
217
- "spec/gherkin/parser/filter_listener_spec.rb",
218
- "spec/gherkin/parser/parser_spec.rb",
219
- "spec/gherkin/parser/tag_expression_spec.rb",
220
- "spec/gherkin/rb_lexer_spec.rb",
221
- "spec/gherkin/sexp_recorder.rb",
222
- "spec/gherkin/shared/lexer_spec.rb",
223
- "spec/gherkin/shared/py_string_spec.rb",
224
- "spec/gherkin/shared/row_spec.rb",
225
- "spec/gherkin/shared/tags_spec.rb",
226
- "spec/spec_helper.rb"
227
- ]
228
-
229
- if s.respond_to? :specification_version then
230
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
231
- s.specification_version = 3
232
-
233
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
234
- s.add_runtime_dependency(%q<trollop>, [">= 1.15"])
235
- s.add_development_dependency(%q<rspec>, [">= 1.3.0"])
236
- s.add_development_dependency(%q<cucumber>, [">= 0.6.4"])
237
- s.add_development_dependency(%q<rake-compiler>, [">= 0.7.0"])
238
- s.add_development_dependency(%q<albacore>, [">= 0.1.2"])
239
- else
240
- s.add_dependency(%q<trollop>, [">= 1.15"])
241
- s.add_dependency(%q<rspec>, [">= 1.3.0"])
242
- s.add_dependency(%q<cucumber>, [">= 0.6.4"])
243
- s.add_dependency(%q<rake-compiler>, [">= 0.7.0"])
244
- s.add_dependency(%q<albacore>, [">= 0.1.2"])
245
- end
246
- else
247
- s.add_dependency(%q<trollop>, [">= 1.15"])
248
- s.add_dependency(%q<rspec>, [">= 1.3.0"])
249
- s.add_dependency(%q<cucumber>, [">= 0.6.4"])
250
- s.add_dependency(%q<rake-compiler>, [">= 0.7.0"])
251
- s.add_dependency(%q<albacore>, [">= 0.1.2"])
252
- end
253
- end
254
-
@@ -1,16 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
- <component name="NewModuleRootManager" inherit-compiler-output="false">
4
- <output url="file://$MODULE_DIR$/target/classes" />
5
- <output-test url="file://$MODULE_DIR$/target/test-classes" />
6
- <content url="file://$MODULE_DIR$">
7
- <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8
- <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
9
- <excludeFolder url="file://$MODULE_DIR$/target" />
10
- </content>
11
- <orderEntry type="inheritedJdk" />
12
- <orderEntry type="sourceFolder" forTests="false" />
13
- <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.8.1" level="project" />
14
- </component>
15
- </module>
16
-
@@ -1,240 +0,0 @@
1
- namespace Gherkin.Lexer
2
- {
3
- using System.Text;
4
- using System.Text.RegularExpressions;
5
- using System.IO;
6
- using System.Collections.Generic;
7
- using System.Linq;
8
-
9
- [Language("<%= @i18n.sanitized_key.downcase %>")]
10
- public class <%= @i18n.sanitized_key.capitalize %> : ILexer {
11
- %%{
12
- machine lexer;
13
- alphtype char;
14
-
15
- action begin_content {
16
- contentStart = p;
17
- contentCol = p - lastNewline + 1;
18
- contentNewline = lastNewline;
19
- currentLine = lineNumber;
20
- }
21
-
22
- action start_pystring {
23
- currentLine = lineNumber;
24
- pystringStartCol = p - lastNewline;
25
- pystringStartNewline = lastNewline;
26
- }
27
-
28
- action begin_pystring_content {
29
- contentStart = p;
30
- }
31
-
32
- action store_pystring_content {
33
- string con = Unindent(pystringStartCol, new Regex("(\\r?\\n)?( )*\\Z").Replace(Substring(data, contentStart, nextKeywordStart-1), "", 1));
34
- listener.PythonString(new Token(con, GetCharacterPosition(data, pystringStartNewline, currentLine, pystringStartCol+1)));
35
- }
36
-
37
- action store_feature_content {
38
- string con = MultilineStrip(KeywordContent(data, p, eof, nextKeywordStart, contentStart).Trim());
39
- listener.Feature(new Token(keyword, GetCharacterPosition(data, keywordNewline, currentLine, keywordCol)), new Token(con, GetCharacterPosition(data, contentNewline, currentLine, contentCol)));
40
- if(nextKeywordStart != -1) p = nextKeywordStart - 1;
41
- nextKeywordStart = -1;
42
- }
43
-
44
- action store_background_content {
45
- string con = MultilineStrip(KeywordContent(data, p, eof, nextKeywordStart, contentStart));
46
- listener.Background(new Token(keyword, GetCharacterPosition(data, keywordNewline, currentLine, keywordCol)), new Token(con, GetCharacterPosition(data, contentNewline, currentLine, contentCol)));
47
- if(nextKeywordStart != -1) p = nextKeywordStart - 1;
48
- nextKeywordStart = -1;
49
- }
50
-
51
- action store_scenario_content {
52
- string con = MultilineStrip(KeywordContent(data, p, eof, nextKeywordStart, contentStart));
53
- listener.Scenario(new Token(keyword, GetCharacterPosition(data, keywordNewline, currentLine, keywordCol)), new Token(con, GetCharacterPosition(data, contentNewline, currentLine, contentCol)));
54
- if(nextKeywordStart != -1) p = nextKeywordStart - 1;
55
- nextKeywordStart = -1;
56
- }
57
-
58
- action store_scenario_outline_content {
59
- string con = MultilineStrip(KeywordContent(data, p, eof, nextKeywordStart, contentStart));
60
- listener.ScenarioOutline(new Token(keyword, GetCharacterPosition(data, keywordNewline, currentLine, keywordCol)), new Token(con, GetCharacterPosition(data, contentNewline, currentLine, contentCol)));
61
- if(nextKeywordStart != -1) p = nextKeywordStart - 1;
62
- nextKeywordStart = -1;
63
- }
64
-
65
- action store_examples_content {
66
- string con = MultilineStrip(KeywordContent(data, p, eof, nextKeywordStart, contentStart));
67
- listener.Examples(new Token(keyword, GetCharacterPosition(data, keywordNewline, currentLine, keywordCol)), new Token(con, GetCharacterPosition(data, contentNewline, currentLine, contentCol)));
68
- if(nextKeywordStart != -1) p = nextKeywordStart - 1;
69
- nextKeywordStart = -1;
70
- }
71
-
72
- action store_step_content {
73
- listener.Step(
74
- new Token(keyword, GetCharacterPosition(data, keywordNewline, currentLine, keywordCol)),
75
- new Token(Substring(data, contentStart, p).Trim(), GetCharacterPosition(data, contentNewline, currentLine, contentCol)),
76
- LookupStepKind(keyword));
77
- }
78
-
79
- action store_comment_content {
80
- listener.Comment(new Token(Substring(data, contentStart, p).Trim(), GetCharacterPosition(data, contentNewline, currentLine, contentCol)));
81
- keywordStart = -1;
82
- }
83
-
84
- action store_tag_content {
85
- listener.Tag(new Token(Substring(data, contentStart, p).Trim(), GetCharacterPosition(data, contentNewline, currentLine, contentCol-1)));
86
- keywordStart = -1;
87
- }
88
-
89
- action inc_line_number {
90
- lineNumber++;
91
- }
92
-
93
- action last_newline {
94
- lastNewline = p + 1;
95
- }
96
-
97
- action start_keyword {
98
- if(keywordStart == -1) keywordStart = p;
99
- if(nextKeywordStart == -1)
100
- {
101
- keywordCol = p - lastNewline + 1;
102
- keywordNewline = lastNewline;
103
- }
104
- }
105
-
106
- action end_keyword {
107
- keyword = new Regex(":$").Replace(Substring(data, keywordStart, p), "", 1);
108
- keywordStart = -1;
109
- }
110
-
111
- action next_keyword_start {
112
- nextKeywordStart = p;
113
- }
114
-
115
- action start_row {
116
- p = p - 1;
117
- contentCol = p - lastNewline + 1;
118
- currentRow = new List<Token>();
119
- currentLine = lineNumber;
120
- }
121
-
122
- action begin_cell_content {
123
- contentStart = p;
124
- }
125
-
126
- action store_cell_content {
127
- currentRow.Add(new Token(Substring(data, contentStart, p).Trim(), GetCharacterPosition(data, lastNewline, lineNumber, contentStart - lastNewline + 1)));
128
- }
129
-
130
- action store_row {
131
- listener.Row(currentRow, GetCharacterPosition(data, contentNewline, currentLine, contentCol));
132
- }
133
-
134
- action end_feature {
135
- if(cs < lexer_first_final) {
136
- string content = CurrentLineContent(data, lastNewline);
137
- throw new LexingException("Lexing error on line " + lineNumber + ": '" + content + "'");
138
- } else {
139
- listener.Eof();
140
- }
141
- }
142
-
143
- include lexer_common "lexer_common.<%= @i18n.sanitized_key %>.rl";
144
- }%%
145
-
146
- private readonly IListener listener;
147
-
148
- private static readonly IDictionary<string, StepKind> stepKeywords = new Dictionary<string, StepKind>();
149
-
150
- static <%= @i18n.sanitized_key.capitalize %>()
151
- {
152
- <% @i18n.keywords('given', true).reject{|kw| kw == '* '}.each do |keyword| %>
153
- stepKeywords["<%=keyword%>"] = StepKind.Given;
154
- <% end %>
155
- <% @i18n.keywords('when', true).reject{|kw| kw == '* '}.each do |keyword| %>
156
- stepKeywords["<%=keyword%>"] = StepKind.When;
157
- <% end %>
158
- <% @i18n.keywords('then', true).reject{|kw| kw == '* '}.each do |keyword| %>
159
- stepKeywords["<%=keyword%>"] = StepKind.Then;
160
- <% end %>
161
- <% @i18n.keywords('and', true).reject{|kw| kw == '* '}.each do |keyword| %>
162
- stepKeywords["<%=keyword%>"] = StepKind.And;
163
- <% end %>
164
- <% @i18n.keywords('but', true).reject{|kw| kw == '* '}.each do |keyword| %>
165
- stepKeywords["<%=keyword%>"] = StepKind.But;
166
- <% end %>
167
- stepKeywords["* "] = StepKind.Any;
168
- }
169
-
170
- private static StepKind LookupStepKind(string keyword)
171
- {
172
- if (!stepKeywords.Keys.Contains(keyword))
173
- return StepKind.Unknown;
174
- return stepKeywords[keyword];
175
- }
176
-
177
- public <%= @i18n.sanitized_key.capitalize %>(IListener listener) {
178
- this.listener = listener;
179
-
180
- }
181
-
182
- %% write data noerror;
183
-
184
- public void Scan(TextReader inputSequence) {
185
- string input = inputSequence.ReadToEnd() + "\n%_FEATURE_END_%";
186
- char[] data = Encoding.GetEncoding("iso-8859-1").GetChars(Encoding.UTF8.GetBytes(input));
187
- int cs, p = 0, pe = data.Length;
188
- int eof = pe;
189
-
190
- int lineNumber = 1;
191
- int lastNewline = 0;
192
-
193
- int keywordCol = -1;
194
- int keywordNewline = 0;
195
- int contentCol = -1;
196
- int contentNewline = 0;
197
- int contentStart = -1;
198
- int currentLine = -1;
199
- int pystringStartNewline = 0;
200
- int pystringStartCol = -1;
201
- int nextKeywordStart = -1;
202
- int keywordStart = -1;
203
- string keyword = null;
204
- IList<Token> currentRow = null;
205
-
206
- %% write init;
207
- %% write exec;
208
- }
209
-
210
- private string KeywordContent(char[] data, int p, int eof, int nextKeywordStart, int contentStart) {
211
- int endPoint = (nextKeywordStart == -1 || (p == eof)) ? p : nextKeywordStart;
212
- return Substring(data, contentStart, endPoint);
213
- }
214
-
215
- private string MultilineStrip(string text) {
216
- var result = new StringBuilder();
217
- foreach (var s in text.Split(new [] {'\n'})) {
218
- result.AppendLine(s.Trim());
219
- }
220
- return result.ToString().Trim();
221
- }
222
-
223
- private string Unindent(int startCol, string text) {
224
- return new Regex("^ {0," + startCol + "}", RegexOptions.Multiline).Replace(text, "");
225
- }
226
-
227
- private string CurrentLineContent(char[] data, int lastNewline) {
228
- return Substring(data, lastNewline, data.Length).Trim();
229
- }
230
-
231
- private string Substring(char[] data, int start, int end) {
232
- return Encoding.UTF8.GetString(Encoding.GetEncoding("iso-8859-1").GetBytes(data, start, end-start));
233
- }
234
-
235
- private Position GetCharacterPosition(char[] data, int lineStart, int line, int bytecol) {
236
- return new Position(line,
237
- Encoding.UTF8.GetCharCount(Encoding.GetEncoding("iso-8859-1").GetBytes(data, lineStart, bytecol)));
238
- }
239
- }
240
- }