ebnf2railroad
Advanced tools
Comparing version 1.8.1 to 1.8.2
@@ -7,2 +7,9 @@ # Changelog | ||
## [1.8.2] - 2019-01-21 | ||
### Changed | ||
- Updated example outputs | ||
### Fixed | ||
- Optimization issue in choice length | ||
## [1.8.1] - 2019-01-21 | ||
@@ -9,0 +16,0 @@ ### Changed |
{ | ||
"name": "ebnf2railroad", | ||
"version": "1.8.1", | ||
"version": "1.8.2", | ||
"description": "EBNF to Railroad diagram", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -86,3 +86,2 @@ const { | ||
const MAX_CHOICE_LENGTH = 10; | ||
const MAX_SEQUENCE_LENGTH = 45; | ||
@@ -117,4 +116,4 @@ const productionToDiagram = (production, options) => { | ||
const choiceLists = []; | ||
while (choiceOptions.length > options.shrinkChoiceAt) { | ||
const subList = choiceOptions.splice(0, options.shrinkChoiceAt); | ||
while (choiceOptions.length > options.maxChoiceLength) { | ||
const subList = choiceOptions.splice(0, options.maxChoiceLength); | ||
choiceLists.push(makeChoice(subList)); | ||
@@ -129,3 +128,3 @@ } | ||
const sequenceLength = determineDiagramSequenceLength(production); | ||
if (sequenceLength > options.maxSequenceLength) { | ||
if (sequenceLength > 45 && options.optimizeSequenceLength) { | ||
const subSequences = production.sequence | ||
@@ -143,3 +142,3 @@ .reduce( | ||
if ( | ||
currentLength + remainingLength > options.maxSequenceLength - 5 && | ||
currentLength + remainingLength > 40 && | ||
currentLength >= 25 && | ||
@@ -271,5 +270,3 @@ remainingLength > 10 | ||
: Infinity, | ||
maxSequenceLength: options.optimizeDiagrams | ||
? MAX_SEQUENCE_LENGTH | ||
: Infinity | ||
optimizeSequenceLength: options.optimizeDiagrams | ||
} | ||
@@ -276,0 +273,0 @@ ); |
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
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
87316
2307