Comments (8)
We have had a discussion about this before, and we are not going to support end-of-line comments, only beginning-of-line ones.
http://groups.google.com/group/specflow/browse_thread/thread/7800c2bc850f85d6
We need to provide better error messages though, so I'll leave this one open.
from gherkin2.
With gherkin 1.0.30 and cucumber 0.7.3:
Feature: Bugz Scenario: Bugz When Bugz | header 1 | header 2 | # here is a comment after a table | cell 1-1 | 'cell 1-2' | | cell 2-1 | "cell 2-2"|
I get:
element size differs (2 should be 5) (IndexError) ./bin/../lib/cucumber/ast/table.rb:79:in `transpose' ./bin/../lib/cucumber/ast/table.rb:79:in `initialize' ./bin/../lib/cucumber/parser/gherkin_builder.rb:126:in `new' ./bin/../lib/cucumber/parser/gherkin_builder.rb:126:in `grab_table!' ./bin/../lib/cucumber/parser/gherkin_builder.rb:110:in `eof' /Users/aslakhellesoy/.rvm/gems/ruby-1.8.7-p249/gems/gherkin-1.0.30/lib/gherkin/parser/event.rb:27:in `__send__'
In other words - it lexes fine, but we get a different error. I would have wanted a lexing error here.
from gherkin2.
Not supporting EOL comments seems like an artificial limitation, especially after tags. People expect to be able to do:
@ignored # explanation why this is ignored
from gherkin2.
The reason is that we want to be able to output features (with the pretty formatter) after it has been parsed. To make this easier we have some grammar limitations. It would be easy to make this parse, but a little more tricky to output it correctly again.
from gherkin2.
Right now (cucumber 1.2.1) I am having to "fix" several feature files that no longer run because some engineers documented their tables with comments. They did the right thing, but I will still have to fix the files and find some way to include this text and associate it wit the specific table items.
Documenting ones work should not be considered an error.
from gherkin2.
+1 for supporting end of line comments in tables
from gherkin2.
Here is a use case:
Scenario Outline: Upload photo from computer/url
Given I'm signed in
And I am at Edit Profile
When I upload photo from my computer
Then this photo is shown at Edit Profile
And this photo is shown in my Profile
Examples:
|from|
|my computer| # Random image from test_data/images folder is taken
|any image url| # Random url is read from test_data/image_urls.yml
from gherkin2.
We'll never support comments at the end of the line. It would make it impossible to do things like:
When I dial "314#" on the telephone
Full story: https://groups.google.com/group/cukes/browse_thread/thread/4b2e1dcbde451db8/7fa3ee833987708e
from gherkin2.
Related Issues (20)
- JS JSONFormatter - No way to attach an embedding without base64 encoding HOT 2
- Unable to compile
- Support i18n in snippet generation HOT 4
- cannot load such file -- 2.1/gherkin_lexer_en HOT 10
- [Java] Ugly formatting for CJK data containing full-width characters
- [Suggestion] Delete merged branches from the repo
- [Ruby] Backslashes in tables HOT 1
- SyntaxError in output HOT 1
- Background.feature is nil (in Cucumber 2.0) HOT 1
- Couldn't load 2.1/gherkin_lexer_en HOT 3
- Scenerios should be randomized across feature files, not just within a feature file HOT 2
- NPE in JSONFormatter in scenario print in a @Before HOT 1
- Getting Lexing Error HOT 5
- Cucumber generating empty JSON file upon multiple feature failures. HOT 1
- cucumber for java: number format exception when using tag with semicolon in name HOT 5
- allow tagging individual outline examples HOT 1
- Request for new release HOT 3
- Pretty formatter cannot handle comments in feature correctly
- Source files without license headers HOT 4
- NullPointerException when 'type' property is missing HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gherkin2.