From 2da622ecf5930b11df12fe61874e311b0782014d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 25 May 2015 20:05:22 +0100 Subject: Add handling for unterminated quoted strings --- project2/sql/sql.ll | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/project2/sql/sql.ll b/project2/sql/sql.ll index b4aab45..924972c 100644 --- a/project2/sql/sql.ll +++ b/project2/sql/sql.ll @@ -48,7 +48,7 @@ dollarquote ("$".[a-zA-Z]."$"|"$$") throw std::runtime_error("Unterminated comment"); } -{comment} { +{comment} { Comment(YYText()); } @@ -85,10 +85,18 @@ dollarquote ("$".[a-zA-Z]."$"|"$$") yy_pop_state(); } +<> { + throw std::runtime_error("Unterminated dollar quoted string"); +} + {any} { statement += YYText(); } +<> { + throw std::runtime_error("Unterminated quoted string"); +} + {term} { Statement(statement); statement.clear(); -- cgit v1.2.3