This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH setup 09/10] Improve error recovery in setup.ini parsing


Following the error token with a NL allows the parser to discard tokens
until a NL is found to resynchronize, rather than aborting.

This doesn't help hugely, as *any* parse errors are considered fatal by
do_remote_ini()/do_local_ini() and won't let us proceed.
---
 iniparse.yy | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iniparse.yy b/iniparse.yy
index 8ee7dc3..c540146 100644
--- a/iniparse.yy
+++ b/iniparse.yy
@@ -104,7 +104,7 @@ singleitem /* non-empty */
  | REQUIRES { iniBuilder->buildBeginDepends(); } versionedpackagelistsp NL
  | BUILDDEPENDS { iniBuilder->buildBeginBuildDepends(); } versionedpackagelist NL
  | MESSAGE STRING STRING NL	{ iniBuilder->buildMessage ($2, $3); }
- | error 			{ yyerror (std::string("unrecognized line ") 
+ | error NL			{ yyerror (std::string("unrecognized line ")
 					  + stringify(yylineno)
 					  + " (do you have the latest setup?)");
 				}
-- 
2.12.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]