summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2015-05-25 20:05:22 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2015-05-25 20:05:22 +0100
commit2da622ecf5930b11df12fe61874e311b0782014d (patch)
tree6564a9cff9089b35c7fd57356a98543e1c238217
parentHandle tagless dollar quoting (diff)
downloadproject2-2da622ecf5930b11df12fe61874e311b0782014d.tar.bz2
project2-2da622ecf5930b11df12fe61874e311b0782014d.tar.xz
project2-2da622ecf5930b11df12fe61874e311b0782014d.zip
Add handling for unterminated quoted strings
-rw-r--r--project2/sql/sql.ll10
1 files changed, 9 insertions, 1 deletions
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();
}
+<DOLLARQUOTE><<EOF>> {
+ throw std::runtime_error("Unterminated dollar quoted string");
+}
+
<QUOTE>{any} {
statement += YYText();
}
+<QUOTE><<EOF>> {
+ throw std::runtime_error("Unterminated quoted string");
+}
+
<STATEMENT>{term} {
Statement(statement);
statement.clear();