Coder Social home page Coder Social logo

Comments (8)

aslakhellesoy avatar aslakhellesoy commented on September 27, 2024

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.

aslakhellesoy avatar aslakhellesoy commented on September 27, 2024

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.

jarib avatar jarib commented on September 27, 2024

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.

aslakhellesoy avatar aslakhellesoy commented on September 27, 2024

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.

cybersquid avatar cybersquid commented on September 27, 2024

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.

abotalov avatar abotalov commented on September 27, 2024

+1 for supporting end of line comments in tables

from gherkin2.

abotalov avatar abotalov commented on September 27, 2024

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.

aslakhellesoy avatar aslakhellesoy commented on September 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.