Comparing version 4.2.0 to 4.2.1
{ | ||
"name": "apg-js", | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"description": "JavaScript APG, an ABNF Parser Generator", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# JavaScript APG | ||
## 4.2.1 Release Notes | ||
Some ABNF grammar authors will use zero repetitions as an explicit empty string acceptor. | ||
That is, one or the other of something like, | ||
> char = %d33-127 | ||
> empty1 = 0char | ||
> empty2 = 0"x" | ||
Previous version of APG have rejected zero repititions as an empty string acceptor in favor of | ||
the more intuitive and simpler to produce and simpler to process empty literal string | ||
> empty = "" | ||
`apg-js` version 4.2.0 and lower neglects to reject the zero repetitions form and, unfortunately, | ||
it only sometimes actually accepts an empty string and sometimes fails. | ||
Version 4.2.1 corrects this. Zero repetitions are allowed as explicit empty string acceptors and | ||
are processed correctly. | ||
Note, however, that zero repetitions is deprecated in that not all implementations of APG accept it | ||
and that is it is slightly less efficient to implement. | ||
Favored is the more streamlined empty literal string, `""` | ||
## 4.2.0 Release Notes | ||
@@ -4,0 +27,0 @@ |
@@ -246,6 +246,6 @@ /* ************************************************************************************* | ||
} | ||
source += '// copyright: Copyright (c) 2021 Lowell D. Thomas, all rights reserved<br>\n'; | ||
source += '// copyright: Copyright (c) 2023 Lowell D. Thomas, all rights reserved<br>\n'; | ||
source += '// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br>\n'; | ||
source += '//\n'; | ||
source += '// Generated by apg-js, Version 4.0.0 [apg-js](https://github.com/ldthomas/apg-js)\n'; | ||
source += '// Generated by apg-js, Version 4.2.1 [apg-js](https://github.com/ldthomas/apg-js)\n'; | ||
source += `${funcname} = function grammar(){\n`; | ||
@@ -252,0 +252,0 @@ source += ' // ```\n'; |
@@ -1,5 +0,5 @@ | ||
// copyright: Copyright (c) 2021 Lowell D. Thomas, all rights reserved<br> | ||
// copyright: Copyright (c) 2023 Lowell D. Thomas, all rights reserved<br> | ||
// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br> | ||
// | ||
// Generated by apg-js, Version 4.0.0 [apg-js](https://github.com/ldthomas/apg-js) | ||
// Generated by apg-js, Version 4.2.1 [apg-js](https://github.com/ldthomas/apg-js) | ||
module.exports = function grammar(){ | ||
@@ -6,0 +6,0 @@ // ``` |
@@ -1,5 +0,5 @@ | ||
// copyright: Copyright (c) 2021 Lowell D. Thomas, all rights reserved<br> | ||
// copyright: Copyright (c) 2023 Lowell D. Thomas, all rights reserved<br> | ||
// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br> | ||
// | ||
// Generated by apg-js, Version 4.0.0 [apg-js](https://github.com/ldthomas/apg-js) | ||
// Generated by apg-js, Version 4.2.1 [apg-js](https://github.com/ldthomas/apg-js) | ||
module.exports = function grammar(){ | ||
@@ -6,0 +6,0 @@ // ``` |
@@ -1,5 +0,5 @@ | ||
// copyright: Copyright (c) 2021 Lowell D. Thomas, all rights reserved<br> | ||
// copyright: Copyright (c) 2023 Lowell D. Thomas, all rights reserved<br> | ||
// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br> | ||
// | ||
// Generated by apg-js, Version 4.0.0 [apg-js](https://github.com/ldthomas/apg-js) | ||
// Generated by apg-js, Version 4.2.1 [apg-js](https://github.com/ldthomas/apg-js) | ||
module.exports = function grammar(){ | ||
@@ -6,0 +6,0 @@ // ``` |
@@ -593,2 +593,9 @@ /* eslint-disable func-names */ | ||
const op = opcodes[opIndex]; | ||
if (op.max === 0) { | ||
// this is an empty-string acceptor | ||
// deprecated: use the TLS empty string operator, "", instead | ||
sysData.state = id.EMPTY; | ||
sysData.phraseLength = 0; | ||
return; | ||
} | ||
repCharIndex = phraseIndex; | ||
@@ -595,0 +602,0 @@ repPhrase = 0; |
@@ -57,3 +57,3 @@ /* ************************************************************************************* | ||
const version = function version() { | ||
return 'JavaScript APG, version 4.0.0\nCopyright (C) 2021 Lowell D. Thomas, all rights reserved\n'; | ||
return 'JavaScript APG, version 4.2.1\nCopyright (C) 2023 Lowell D. Thomas, all rights reserved\n'; | ||
}; | ||
@@ -60,0 +60,0 @@ const STRICTL = '--strict'; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
1450859
15735
112