Skip to content

Commit

Permalink
updated syntax template and added more languages
Browse files Browse the repository at this point in the history
  • Loading branch information
bmabey committed Oct 19, 2008
1 parent 1847b0f commit 0553490
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 35 deletions.
6 changes: 3 additions & 3 deletions Support/bundle_tasks/syntax.rake
Expand Up @@ -17,9 +17,9 @@ class SyntaxGenerator
line_keywords_array.concat(words.values)
end

scenario_keywords = scenario_keywords_array.uniq.join('|')
feature_keywords = feature_keywords_array.uniq.join('|')
line_keywords = line_keywords_array.uniq.join('|')
scenario_keywords = scenario_keywords_array.uniq.compact.join('|')
feature_keywords = feature_keywords_array.uniq.compact.join('|')
line_keywords = line_keywords_array.uniq.compact.join('|')


syntax_file = File.dirname(__FILE__) + '/../../Syntaxes/Cucumber Plain Text Feature.tmLanguage'
Expand Down
61 changes: 55 additions & 6 deletions Support/languages.yml
@@ -1,6 +1,21 @@
# http://en.wikipedia.org/wiki/IETF_language_tag
# http://www.iana.org/assignments/language-subtag-registry
# http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt (Use this I think)
"en":
feature: Feature
scenario: Scenario
more_examples: More Examples
given_scenario: GivenScenario
given: Given
when: When
then: Then
and: And
but: But
# 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)
# are added.
#
# Please keep the grammars in alphabetical order from here and down.
"da":
feature: Egenskab
scenario: Scenarie
Expand All @@ -19,18 +34,21 @@
then: Dann
and: Und
but: Aber
"en":
# Texan
"en-tx":
feature: Feature
scenario: Scenario
more_examples: More Examples
given_scenario: GivenScenario
given: Given
when: When
then: Then
and: And
but: But
given: Given y'all
when: When y'all
then: Then y'all
and: And y'all
but: But y'all
"es":
feature: Característica
scenario: Escenario
more_examples: Más ejemplos
given_scenario: DadoElEscenario
given: Dado
when: Cuando
Expand All @@ -40,15 +58,27 @@
"fr":
feature: Fonction
scenario: Scenario
more_examples: Plus d'exemples
given_scenario: SoitScenario
given: Soit
when: Lorsque
then: Alors
and: Et
but: Mais
"nl":
feature: Functionaliteit
scenario: Scenario
more_examples: Meer voorbeelden
given_scenario: GegevenScenario
given: Gegeven
when: Als
then: Dan
and: En
but: Maar
"no":
feature: Egenskap
scenario: Scenario
more_examples: Flere eksempler
given_scenario: GittScenario
given: Gitt
when: Når
Expand Down Expand Up @@ -91,3 +121,22 @@
then: Siis
and: Ja
but: Kuid
"zh-CN":
feature: 功能
scenario: 场景
given_scenario: 引用场景
given: 假如
when:
then: 那么
and: 而且
but: 但是
"ja":
feature: フィーチャ
scenario: シナリオ
more_examples: 他のサンプル
given_scenario: 前提シナリオ
given: 前提
when: もし
then: ならば
and: かつ
but: しかし
12 changes: 6 additions & 6 deletions Syntaxes/Cucumber Plain Text Feature.tmLanguage
Expand Up @@ -72,7 +72,7 @@
</dict>
</dict>
<key>match</key>
<string>^\s*(As an|As a|I want|So that)(.*)</string>
<string>^\s*(As an|As a|I want|So that|In order)(.*)</string>
</dict>
<key>feature_keyword</key>
<dict>
Expand All @@ -90,7 +90,7 @@
</dict>
</dict>
<key>match</key>
<string>\b(Egenskap|Fonction|Funktionalität|Функционал|Característica|Omadus|Egenskab|Feature:)(.*)\b</string>
<string>\b(フィーチャ|Egenskap|Fonction|Feature|Funktionalität|Функционал|Característica|Omadus|Egenskab|Functionaliteit|功能:)(.*)\b</string>
</dict>
<key>line_keyword</key>
<dict>
Expand All @@ -103,7 +103,7 @@
</dict>
</dict>
<key>match</key>
<string>\b(Gitt|GittScenario|Men|Og|Så|Når|Soit|SoitScenario|Mais|Et|Alors|Lorsque|Gegeben sei|GegebenesSzenario|Aber|Und|Dann|Wenn|Сначала|ДанныйСценарий|Но|И|То|Если|Dado|DadoElEscenario|Pero|Y|Entonces|Cuando|Eeldades|EeldadesStsenaariumit|Kuid|Ja|Siis|Kui|DadoOCenário|Mas|E|Então|Quando|Givet|GivetScenario|Och|När|GivetScenarie|Given|GivenScenario|But|And|Then|When)\b</string>
<string>\b(前提|前提シナリオ|しかし|かつ|ならば|もし|他のサンプル|Gitt|GittScenario|Men|Og|Så|Når|Flere eksempler|Soit|SoitScenario|Mais|Et|Alors|Lorsque|Plus d'exemples|Given y'all|GivenScenario|But y'all|And y'all|Then y'all|When y'all|More Examples|Gegeben sei|GegebenesSzenario|Aber|Und|Dann|Wenn|Сначала|ДанныйСценарий|Но|И|То|Если|Dado|DadoElEscenario|Pero|Y|Entonces|Cuando|Más ejemplos|Eeldades|EeldadesStsenaariumit|Kuid|Ja|Siis|Kui|DadoOCenário|Mas|E|Então|Quando|Givet|GivetScenario|Och|När|GivetScenarie|Gegeven|GegevenScenario|Maar|En|Dan|Als|Meer voorbeelden|Given|But|And|Then|When|假如|引用场景|但是|而且|那么|当)\b</string>
</dict>
<key>pending_keyword</key>
<dict>
Expand Down Expand Up @@ -139,7 +139,7 @@
</dict>
</dict>
<key>match</key>
<string>\b(Scenario|Szenario|Сценарий|Escenario|Stsenaarium|Cenário|Scenarie:)(.*)\b</string>
<string>\b(シナリオ|Scenario|Szenario|Сценарий|Escenario|Stsenaarium|Cenário|Scenarie|场景:)(.*)\b</string>
</dict>
<key>strings</key>
<dict>
Expand All @@ -160,6 +160,6 @@
<key>uuid</key>
<string>85E2C52C-9B16-4A54-81E7-6D8D3ADAEFA8</string>
<key>firstLineMatch</key>
<string>Egenskap|Fonction|Funktionalität|Функционал|Característica|Omadus|Egenskab|Feature(.*)</string>
<string>フィーチャ|Egenskap|Fonction|Feature|Funktionalität|Функционал|Característica|Omadus|Egenskab|Functionaliteit|功能(.*)</string>
</dict>
</plist>
</plist>
42 changes: 22 additions & 20 deletions Syntaxes/plaintext_template.erb
Expand Up @@ -6,6 +6,8 @@
<array>
<string>feature</string>
</array>
<key>keyEquivalent</key>
<string>^~C</string>
<key>name</key>
<string>Cucumber Plain Text Feature</string>
<key>patterns</key>
Expand Down Expand Up @@ -70,7 +72,25 @@
</dict>
</dict>
<key>match</key>
<string>^\s*(As an|As a|I want|So that)(.*)</string>
<string>^\s*(As an|As a|I want|So that|In order)(.*)</string>
</dict>
<key>feature_keyword</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.language.rspec.story</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>string.language.rspec.story.title</string>
</dict>
</dict>
<key>match</key>
<string>\b(<%= feature_keywords %>:)(.*)\b</string>
</dict>
<key>line_keyword</key>
<dict>
Expand Down Expand Up @@ -121,24 +141,6 @@
<key>match</key>
<string>\b(<%= scenario_keywords %>:)(.*)\b</string>
</dict>
<key>feature_keyword</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.language.rspec.story</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>string.language.rspec.story.title</string>
</dict>
</dict>
<key>match</key>
<string>\b(<%= feature_keywords %>:)(.*)\b</string>
</dict>
<key>strings</key>
<dict>
<key>captures</key>
Expand All @@ -160,4 +162,4 @@
<key>firstLineMatch</key>
<string><%= feature_keywords %>(.*)</string>
</dict>
</plist>
</plist>

0 comments on commit 0553490

Please sign in to comment.