Skip to content

Commit

Permalink
Merge pull request #401 from cucumber/cr-fixGherkinJs
Browse files Browse the repository at this point in the history
gherkin js: fix ability to pass language to parser
  • Loading branch information
aslakhellesoy committed Jun 15, 2018
2 parents 0cb5e4c + d379dc3 commit 064915e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gherkin/javascript/Makefile
Expand Up @@ -20,7 +20,7 @@ default: .compared
touch $@

.built: lib/gherkin/parser.js lib/gherkin/gherkin-languages.json $(JAVASCRIPT_FILES) dist/gherkin.js dist/gherkin.min.js yarn.lock
./node_modules/.bin/mocha
./node_modules/.bin/mocha 'test/**/*.js'
touch $@

yarn.lock: package.json
Expand Down
5 changes: 4 additions & 1 deletion gherkin/javascript/dist/gherkin.js
Expand Up @@ -21,7 +21,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module
Expand Down Expand Up @@ -3872,6 +3872,9 @@ module.exports = function Parser(builder) {
if(typeof tokenScanner == 'string') {
tokenScanner = new TokenScanner(tokenScanner);
}
if(typeof tokenMatcher == 'string') {
tokenMatcher = new TokenMatcher(tokenMatcher);
}
tokenMatcher = tokenMatcher || new TokenMatcher();
builder.reset();
tokenMatcher.reset();
Expand Down
8 changes: 4 additions & 4 deletions gherkin/javascript/dist/gherkin.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions gherkin/javascript/gherkin-javascript.razor
Expand Up @@ -49,6 +49,9 @@ module.exports = function Parser(builder) {
if(typeof tokenScanner == 'string') {
tokenScanner = new TokenScanner(tokenScanner);
}
if(typeof tokenMatcher == 'string') {
tokenMatcher = new TokenMatcher(tokenMatcher);
}
tokenMatcher = tokenMatcher || new TokenMatcher();
builder.reset();
tokenMatcher.reset();
Expand Down
3 changes: 3 additions & 0 deletions gherkin/javascript/lib/gherkin/parser.js
Expand Up @@ -48,6 +48,9 @@ module.exports = function Parser(builder) {
if(typeof tokenScanner == 'string') {
tokenScanner = new TokenScanner(tokenScanner);
}
if(typeof tokenMatcher == 'string') {
tokenMatcher = new TokenMatcher(tokenMatcher);
}
tokenMatcher = tokenMatcher || new TokenMatcher();
builder.reset();
tokenMatcher.reset();
Expand Down

0 comments on commit 064915e

Please sign in to comment.