Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed step name after step keyword without space [#265 state:resolved]

  • Loading branch information...
commit 8ea053f495046d38c0442e9049b5c1744590b47d 1 parent 5da1901
@aslakhellesoy aslakhellesoy authored
View
4 History.txt
@@ -10,6 +10,10 @@
* Updated language for Italian (Alessandro Baroni)
* Updated language for Japanese (KAKUTANI Shintaro)
+=== Bugfixes
+* Fixed step name after step keyword without space (#265 Aslak Hellesøy)
+* Backtrace is back in HTML reports
+
== 0.2.2 2009-03-25
This release includes some minor changes to make Cucumber work with pure Java. Cucumber
View
28 lib/cucumber/languages.yml
@@ -20,6 +20,7 @@
then: Then
and: And
but: But
+ space_after_keyword: true
# Please help us keeping the languages below uptodate. The parsers for a language
# that is missing a keyword will expect the English word until the missing word(s)
@@ -41,6 +42,7 @@
then: اذاً|ثم
and: و
but: لكن
+ space_after_keyword: true
"cy":
name: Welsh
native: Cymraeg
@@ -53,6 +55,7 @@
then: Yna
and: A
but: Ond
+ space_after_keyword: true
"cz":
name: Czech
native: Česky
@@ -67,6 +70,7 @@
then: Pak
and: A
but: Ale
+ space_after_keyword: true
"da":
name: Danish
native: dansk
@@ -81,6 +85,7 @@
then:
and: Og
but: Men
+ space_after_keyword: true
"de":
name: German
native: Deutsch
@@ -95,6 +100,7 @@
then: Dann
and: Und
but: Aber
+ space_after_keyword: true
"en-au":
name: Australian
native: Australian
@@ -109,6 +115,7 @@
then: Ya gotta
and: N
but: Cept
+ space_after_keyword: true
"en-lol":
name: LOLCAT
native: LOLCAT
@@ -123,6 +130,7 @@
then: DEN
and: AN
but: BUT
+ space_after_keyword: true
"en-tx":
name: Texan
native: Texan
@@ -137,6 +145,7 @@
then: Then y'all
and: And y'all
but: But y'all
+ space_after_keyword: true
"es":
name: Spanish
native: español
@@ -151,6 +160,7 @@
then: Entonces
and: Y
but: Pero
+ space_after_keyword: true
"et":
name: Estonian
native: eesti keel
@@ -165,6 +175,7 @@
then: Siis
and: Ja
but: Kuid
+ space_after_keyword: true
"fi":
name: Finnish
native: suomi
@@ -179,6 +190,7 @@
then: Niin
and: Ja
but: Mutta
+ space_after_keyword: true
"fr":
name: French
native: français
@@ -193,6 +205,7 @@
then: Alors
and: Et
but: Mais
+ space_after_keyword: true
"id":
name: Indonesian
native: Bahasa Indonesia
@@ -207,6 +220,7 @@
then: Maka
and: Dan
but: Tapi
+ space_after_keyword: true
"it":
name: Italian
native: italiano
@@ -221,6 +235,7 @@
then: Allora
and: E
but: Ma
+ space_after_keyword: true
"ja":
name: Japanese
native: 日本語
@@ -235,6 +250,7 @@
then: ならば
and: かつ
but: しかし
+ space_after_keyword: false
"lt":
name: Lithuanian
native: lietuvių kalba
@@ -247,6 +263,7 @@
then: Tada
and: Ir
but: Bet
+ space_after_keyword: true
"nl":
name: Dutch
native: Nederlands
@@ -261,6 +278,7 @@
then: Dan
and: En
but: Maar
+ space_after_keyword: true
"no":
name: Norwegian
native: norsk
@@ -275,6 +293,7 @@
then:
and: Og
but: Men
+ space_after_keyword: true
"pl":
name: Polish
native: polski
@@ -286,6 +305,7 @@
then: Wtedy
and: Oraz
but: Ale
+ space_after_keyword: true
"pt":
name: Portuguese
native: português
@@ -300,6 +320,7 @@
then: Então
and: E
but: Mas
+ space_after_keyword: true
"ro":
name: Romanian
native: română
@@ -311,6 +332,7 @@
then: Atunci
and: Si
but: Dar
+ space_after_keyword: true
"ro2":
name: Romanian (diacritical)
native: română (diacritical)
@@ -322,6 +344,7 @@
then: Atunci
and: Și
but: Dar
+ space_after_keyword: true
"ru":
name: Russian
native: русский
@@ -336,6 +359,7 @@
then: То
and: И|К тому же
but: Но|А
+ space_after_keyword: true
"se":
name: Swedish
native: Svenska
@@ -350,6 +374,7 @@
then:
and: Och
but: Men
+ space_after_keyword: true
"zh-CN":
name: Chinese simplified
native: 简体中文
@@ -364,6 +389,7 @@
then: 那么
and: 而且
but: 但是
+ space_after_keyword: false
"zh-TW":
name: Chinese traditional
native: 繁體中文
@@ -378,6 +404,7 @@
then: 那麼
and: 而且|並且
but: 但是
+ space_after_keyword: false
"ko":
name: Korean
native: 한국어
@@ -392,3 +419,4 @@
then: 그러면
and: 그리고
but: 하지만
+ space_after_keyword: false
View
9 lib/cucumber/parser.rb
@@ -13,12 +13,6 @@ module Cucumber
#
# The AST classes are defined in the Cucumber::Ast module.
module Parser
- translator = Module.new do
- def keywordz(key)
- 'Scenario'
- end
- end
-
def self.load_parser(keywords)
Loader.new(keywords)
end
@@ -34,7 +28,8 @@ def initialize(keywords)
require 'cucumber/parser/feature'
end
- def keywords(key)
+ def keywords(key, raw=false)
+ return @keywords[key] if raw
values = @keywords[key].split('|')
values.map{|value| "'#{value}'"}.join(" / ")
end
View
73 lib/cucumber/parser/feature.rb
@@ -870,6 +870,10 @@ def step_keyword
elements[2]
end
+ def keyword_space
+ elements[3]
+ end
+
def name
elements[4]
end
@@ -920,60 +924,51 @@ def _nt_step
r4 = _nt_step_keyword
s0 << r4
if r4
- s5, i5 = [], index
- loop do
- r6 = _nt_space
- if r6
- s5 << r6
- else
- break
- end
- end
- r5 = SyntaxNode.new(input, i5...index, s5)
+ r5 = _nt_keyword_space
s0 << r5
if r5
- r7 = _nt_line_to_eol
- s0 << r7
- if r7
- i8 = index
- s9, i9 = [], index
+ r6 = _nt_line_to_eol
+ s0 << r6
+ if r6
+ i7 = index
+ s8, i8 = [], index
loop do
- r10 = _nt_eol
- if r10
- s9 << r10
+ r9 = _nt_eol
+ if r9
+ s8 << r9
else
break
end
end
- if s9.empty?
- self.index = i9
- r9 = nil
+ if s8.empty?
+ self.index = i8
+ r8 = nil
else
- r9 = SyntaxNode.new(input, i9...index, s9)
+ r8 = SyntaxNode.new(input, i8...index, s8)
end
- if r9
- r8 = r9
+ if r8
+ r7 = r8
else
- r11 = _nt_eof
- if r11
- r8 = r11
+ r10 = _nt_eof
+ if r10
+ r7 = r10
else
- self.index = i8
- r8 = nil
+ self.index = i7
+ r7 = nil
end
end
- s0 << r8
- if r8
- r13 = _nt_multiline_arg
- if r13
- r12 = r13
+ s0 << r7
+ if r7
+ r12 = _nt_multiline_arg
+ if r12
+ r11 = r12
else
- r12 = SyntaxNode.new(input, index...index)
+ r11 = SyntaxNode.new(input, index...index)
end
- s0 << r12
- if r12
- r14 = _nt_white
- s0 << r14
+ s0 << r11
+ if r11
+ r13 = _nt_white
+ s0 << r13
end
end
end
View
2  lib/cucumber/parser/feature.tt
@@ -121,7 +121,7 @@ module Cucumber
end
rule step
- comment space* step_keyword space* name:line_to_eol (eol+ / eof) multi:multiline_arg? white {
+ comment space* step_keyword keyword_space name:line_to_eol (eol+ / eof) multi:multiline_arg? white {
def build
if multi.respond_to?(:build)
Ast::Step.new(step_keyword.line, step_keyword.text_value, name.text_value.strip, multi.build)
View
4 lib/cucumber/parser/i18n.tt
@@ -22,6 +22,10 @@ module Cucumber
(<%= keywords('but') %>)
end
+ rule keyword_space
+ <%= keywords('space_after_keyword', true) ? 'space+' : 'space*' %>
+ end
+
rule examples_keyword
(<%= keywords('examples') %>) ':'?
end
Please sign in to comment.
Something went wrong with that request. Please try again.