Commit 174ac719 authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Allow bool type params

parent acde4276
......@@ -51,6 +51,7 @@ unsignedlong ("0x"|"0X"){hexdigit}{5,}
floatcast "("[ \t]*"float"[ \t]*")"
doublecast "("[ \t]*"double"[ \t]*")"
intcast "("[ \t]*"int"[ \t]*")"
boolcast "("[ \t]*"bool"[ \t]*")"
%%
......@@ -67,6 +68,7 @@ intcast "("[ \t]*"int"[ \t]*")"
{floatcast} { return FLOATCASTSYM; }
{doublecast} { return DOUBLECASTSYM; }
{intcast} { return INTCASTSYM; }
{boolcast} { return BOOLCASTSYM; }
{string} {
yylval->string = strdup(yytext + 1);
......@@ -94,6 +96,8 @@ intcast "("[ \t]*"int"[ \t]*")"
{comment} /* skip */
[ \t\r] /* skip */
#.* /* skip */
"\n" { yyset_lineno(yyget_lineno(yyscanner)+1, yyscanner);}
%%
......
......@@ -57,6 +57,7 @@ void yyerror(yyscan_t *scanner, char const *s);
%token FLOATCASTSYM
%token DOUBLECASTSYM
%token INTCASTSYM
%token BOOLCASTSYM
%union
{
......@@ -138,6 +139,10 @@ var : STRINGSYM
{ controller_load_var_add_dbl($2); }
| DOUBLECASTSYM INTSYM
{ controller_load_var_add_dbl($2); }
| BOOLSYM
{ controller_load_var_add_int($1); }
| BOOLCASTSYM INTSYM
{ controller_load_var_add_int($2); }
| INTSYM
{ controller_load_var_add_int($1); }
| INTCASTSYM INTSYM
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment