%type <str> opt_setup opt_teardown
%type <str> setup
%type <ptr_list> step_list session_list permutation_list opt_permutation_list
-%type <ptr_list> string_list
+%type <ptr_list> string_literal_list
%type <session> session
%type <step> step
%type <permutation> permutation
-%token <str> sqlblock string
+%token <str> sqlblock string_literal
%token PERMUTATION SESSION SETUP STEP TEARDOWN TEST
%%
;
session:
- SESSION string opt_setup step_list opt_teardown
+ SESSION string_literal opt_setup step_list opt_teardown
{
$$ = malloc(sizeof(Session));
$$->name = $2;
step:
- STEP string sqlblock
+ STEP string_literal sqlblock
{
$$ = malloc(sizeof(Step));
$$->name = $2;
permutation:
- PERMUTATION string_list
+ PERMUTATION string_literal_list
{
$$ = malloc(sizeof(Permutation));
$$->stepnames = (char **) $2.elements;
}
;
-string_list:
- string_list string
+string_literal_list:
+ string_literal_list string_literal
{
$$.elements = realloc($1.elements,
($1.nelements + 1) * sizeof(void *));
$$.elements[$1.nelements] = $2;
$$.nelements = $1.nelements + 1;
}
- | string
+ | string_literal
{
$$.nelements = 1;
$$.elements = malloc(sizeof(void *));
litbuf[litbufpos] = '\0';
yylval.str = strdup(litbuf);
BEGIN(INITIAL);
- return(string);
+ return(string_literal);
}
<qstr>. { addlitchar(yytext[0]); }
<qstr>\n { yyerror("unexpected newline in quoted string"); }