Giter Club home page Giter Club logo

Comments (11)

mrcasals avatar mrcasals commented on September 27, 2024

Any idea on how to start working on this?

from gherkin-ruby.

mrcasals avatar mrcasals commented on September 27, 2024

I need this, I'll start working on it and ask form help if I get stuck... But it looks like I should start from here, right?

https://github.com/codegram/gherkin-ruby/blob/master/lib/gherkin/parser/lexer.rb#L61-104

from gherkin-ruby.

txus avatar txus commented on September 27, 2024

We need to hook into the lexer (defined here, the file you mentioned is autogenerated from this one) to identify the header like:

# language: ca
Feature: Fer alguna cosa

And then use the corresponding set of tokens. The lexer is written in Rexical, so we just need to figure out how to execute some code before, dynamically set which set of tokens are we using, and then let the lexer tokenize the file, and then we're done. Makes sense?

from gherkin-ruby.

txus avatar txus commented on September 27, 2024

Actually it's very easy, look at this part of the code. Here, before the call to scan_setup(code), we should define an instance variable with a hash or something like this:

locale = code.scan(/language/ bla bla whatever
@tokens = get_tokens_from_locale(locale) # => this would return something like { :When => "Quan", :Then => "Llavors" ... }
scan_setup(code)

And then I don't know how to use these tokens in the lexer. But it's something. What do you think?

from gherkin-ruby.

mrcasals avatar mrcasals commented on September 27, 2024

Looks nice to me, but I don't see myself succeeding on this alone...

Marc Riera Casals

On Saturday, April 7, 2012 at 4:02 PM, Josep M. Bach wrote:

Actually it's very easy, look at this part of the code. Here, before the call to scan_setup(code), we should define an instance variable with a hash or something like this:

locale = code.scan(/language/ bla bla whatever
@tokens = get_tokens_from_locale(locale) # => this would return something like { :When => "Quan", :Then => "Llavors" ... }
scan_setup(code)

And then I don't know how to use these tokens in the lexer. But it's something. What do you think?


Reply to this email directly or view it on GitHub:
#6 (comment)

from gherkin-ruby.

txus avatar txus commented on September 27, 2024

Just a small status update, anyone up for implementing this? @mrcasals @Dor3nz @divins @oriolgual @josepjaume ?

from gherkin-ruby.

oriolgual avatar oriolgual commented on September 27, 2024

We haven't actually needed this, so.... :P

from gherkin-ruby.

mrcasals avatar mrcasals commented on September 27, 2024

I do have needed this, but I don't know how to fixnit :(
On Sep 14, 2012 7:13 PM, "Oriol Gual" [email protected] wrote:

We haven't actually needed this, so.... :P


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-8568472.

from gherkin-ruby.

jmgarnier avatar jmgarnier commented on September 27, 2024

Sorry, I will not contribute because I'm working on my own vegetable: a Gherkin DSL on top of RSpec: https://github.com/21croissants/maniok_bdd/

from gherkin-ruby.

oriolgual avatar oriolgual commented on September 27, 2024

OK, nevermind.

from gherkin-ruby.

RunsFor avatar RunsFor commented on September 27, 2024

Hi,

I'm wondering if this feature are planned to be implemented?

from gherkin-ruby.

Related Issues (15)

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.