Code Monkey home page Code Monkey logo

Comments (2)

ciaranmcnulty avatar ciaranmcnulty commented on June 23, 2024

In general we aren't going to make any gherkin syntax changes here - rather we are striving for more and more compatibility.

It might be one for https://github.com/cucumber/gherkin if we can do it in a language-agnostic way?

from behat.

ash-m avatar ash-m commented on June 23, 2024

For anyone that comes across this, if you want to quickly remap your arguments to the word before (excluding "of"), here's an awk script:

/@(Given|When|Then)/ {
    str = $0
    while (str != "" && match(str, /(\S+)( of)? [^\w\s]?:(\S+)/, arr) > 0) {
        str = substr(str, RSTART + (RLENGTH ? RLENGTH : 1))
        k = n[arr[1]]++ ? arr[1] n[arr[1]] : arr[1]
        k = gensub(/(\s|-)(.)/, "_\\2", "g", k)
        k = gensub(/\W/, "", "g", k)
        a[k] = arr[3]
    }
}

/[:$]arg/ { for (key in a) { gsub(a[key], key) } }
/^    }/ { delete a; delete n } 1

It doesn't look for any special characters; it just takes the word beforehand. If you have multiple of the same you get a number: function some_example($price, $address, $address2, $price2, $the) // some might not make sense

from behat.

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.