summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 865b0a3)
raw | patch | inline | side by side (parent: 865b0a3)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 11 Dec 2014 21:06:49 +0000 (22:06 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 11 Dec 2014 21:06:49 +0000 (22:06 +0100) |
… and focus only on syntax elements that may include semicolons and escape
their meaning as a query terminator.
their meaning as a query terminator.
src/tools/sysdb/scanner.l | patch | blob | history |
index cd465ce67f87be50c0456869053a7c88469e6484..1404690a1256354f078ab87f863e516d57ff270e 100644 (file)
%x CSC
-whitespace ([ \t\n\r\f]+)
+newline ([\n\r]+)
simple_comment ("--"[^\n\r]*)
/*
csc_inside ([^*/]+|[^*]\/|\*[^/])
csc_end \*\/
-identifier ([A-Za-z_][A-Za-z_0-9$]*)
+/*
+ * Strings.
+ */
+/* TODO: fully support SQL strings */
+string ('([^']|'')*')
%%
-{whitespace} { APPEND(); }
+ /*
+ * Here, we only care about syntax elements that may include semicolons
+ * and escape their meaning as a query terminator.
+ */
+
{simple_comment} { APPEND(); }
{csc_start} { APPEND(); BEGIN(CSC); }
<CSC>{csc_end} { APPEND(); BEGIN(INITIAL); }
<CSC><<EOF>> { return -1; }
-{identifier} { APPEND(); }
+{string} { APPEND(); }
/*
* The following rules are specific to the command line tool.
*/
-";" { APPEND(); sdb_input_exec_query(); }
+";" { APPEND(); sdb_input_exec_query(); }
-. { APPEND(); }
+. { APPEND(); }
+{newline} { APPEND(); }
%%