Comments (11)
Any idea on how to start working on this?
from gherkin-ruby.
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.
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.
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.
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.
Just a small status update, anyone up for implementing this? @mrcasals @Dor3nz @divins @oriolgual @josepjaume ?
from gherkin-ruby.
We haven't actually needed this, so.... :P
from gherkin-ruby.
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.
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.
OK, nevermind.
from gherkin-ruby.
Hi,
I'm wondering if this feature are planned to be implemented?
from gherkin-ruby.
Related Issues (15)
- Find a better naming HOT 2
- Ruby ships with racc, why depend on it as gem? HOT 5
- Rename 'gherkin.rb' to 'gherkin-ruby.rb' HOT 2
- Add support for tags HOT 3
- Support PyStrings HOT 1
- 'And' in feature description make exception HOT 1
- 'Button' in scenario make exception HOT 1
- Support Tables or Document Not Supporting Tables HOT 1
- Prerequisite knowledge for adding support for Docstrings HOT 4
- Support Tables
- Handle Background:
- Support tables HOT 1
- Chokes on comments
- Chokes on blank lines that have whitespace
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 gherkin-ruby.