<para>
Script file meta commands begin with a backslash (<literal>\</>) and
- extend to the end of the line.
+ normally extend to the end of the line, although they can be continued
+ to additional lines by writing backslash-return.
Arguments to a meta command are separated by white space.
These meta commands are supported:
</para>
Examples:
<programlisting>
\set ntellers 10 * :scale
-\set aid (1021 * random(1, 100000 * :scale)) % (100000 * :scale) + 1
+\set aid (1021 * random(1, 100000 * :scale)) % \
+ (100000 * :scale) + 1
</programlisting></para>
</listitem>
</varlistentry>
nonspace [^ \t\r\f\v\n]
newline [\n]
+/* Line continuation marker */
+continuation \\{newline}
+
/* Exclusive states */
%x EXPR
return 1;
}
+ /*
+ * We need this rule to avoid returning "word\" instead of recognizing
+ * a continuation marker just after a word:
+ */
+{nonspace}+{continuation} {
+ /* Found "word\\\n", emit and return just "word" */
+ psqlscan_emit(cur_state, yytext, yyleng - 2);
+ return 1;
+ }
+
{space}+ { /* ignore */ }
+{continuation} { /* ignore */ }
+
{newline} {
/* report end of command */
last_was_newline = true;
return FUNCTION;
}
+{space}+ { /* ignore */ }
+
+{continuation} { /* ignore */ }
+
{newline} {
/* report end of command */
last_was_newline = true;
return 0;
}
-{space}+ { /* ignore */ }
-
. {
/*
* must strdup yytext so that expr_yyerror_more doesn't