[PATCH setup 08/10] Fix infinite recursion in grammar for depends

Jon Turney jon.turney@dronecode.org.uk
Tue May 23 16:59:00 GMT 2017


Allowing listseparator to be empty allows an infinite recursion in the
versionedpackagelist rule

Also make the comment documenting versionedpackageentry is non-empty
consistent with all other similar comments

Also allow lower-case depends:
---
 inilex.ll   | 2 +-
 iniparse.yy | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/inilex.ll b/inilex.ll
index 798a04b..b454f0f 100644
--- a/inilex.ll
+++ b/inilex.ll
@@ -121,7 +121,7 @@ B64	[a-zA-Z0-9_-]
 
 "category:"|"Section:"	return CATEGORY;
 "requires:"		return REQUIRES;
-"Depends:"		return DEPENDS;
+[dD]"epends:"		return DEPENDS;
 
 ^{STR}":"		ignore_line ();
 
diff --git a/iniparse.yy b/iniparse.yy
index d768400..8ee7dc3 100644
--- a/iniparse.yy
+++ b/iniparse.yy
@@ -132,12 +132,12 @@ versionedpackagelistsp /* non-empty */
  | versionedpackagelistsp versionedpackageentry
  ;
 
-listseparator: /* empty */
- | COMMA
+listseparator /* non-empty */
+ : COMMA
  | COMMA NL
  ;
 
-versionedpackageentry /* empty not allowed */
+versionedpackageentry /* non-empty */
  : STRING { iniBuilder->buildPackageListNode($1); } versioncriteria
  ;
 
-- 
2.12.3



More information about the Cygwin-apps mailing list