Comparing version 3.1.1 to 3.1.2
var Token = require('./token'); | ||
var GherkinLine = require('./gherkin_line'); | ||
/** | ||
* The scanner reads a gherkin doc (typically read from a .feature file) and creates a token for each line. | ||
* The tokens are passed to the parser, which outputs an AST (Abstract Syntax Tree). | ||
* | ||
* If the scanner sees a `#` language header, it will reconfigure itself dynamically to look for | ||
* Gherkin keywords for the associated language. The keywords are defined in gherkin-languages.json. | ||
*/ | ||
module.exports = function TokenScanner(source) { | ||
@@ -5,0 +12,0 @@ var lines = source.split(/\r?\n/); |
{ | ||
"name": "gherkin", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "Gherkin parser", | ||
@@ -24,5 +24,5 @@ "main": "index.js", | ||
"devDependencies": { | ||
"bower": "^1.5.2", | ||
"browserify": "^11.0.1", | ||
"mocha": "^2.3.0", | ||
"bower": "^1.5.3", | ||
"browserify": "^11.2.0", | ||
"mocha": "^2.3.3", | ||
"mversion": "^1.10.1", | ||
@@ -29,0 +29,0 @@ "uglify-js": "^2.4.24" |
@@ -105,2 +105,21 @@ var assert = require('assert'); | ||
}); | ||
it("can change the default language", function () { | ||
var parser = new Gherkin.Parser(new Gherkin.AstBuilder()); | ||
var matcher = new Gherkin.TokenMatcher("no"); | ||
var scanner = new Gherkin.TokenScanner("Egenskap: i18n support"); | ||
var ast = parser.parse(scanner, matcher); | ||
assert.deepEqual(ast, { | ||
type: 'Feature', | ||
tags: [], | ||
location: { line: 1, column: 1 }, | ||
language: 'no', | ||
keyword: 'Egenskap', | ||
name: 'i18n support', | ||
description: undefined, | ||
background: undefined, | ||
scenarioDefinitions: [], | ||
comments: [] | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
373373
29
11259
1
4