mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
qfcc now supports implicit string constant concatentation.
This commit is contained in:
parent
4f7245d634
commit
aa006ecf64
1 changed files with 20 additions and 4 deletions
|
@ -119,6 +119,7 @@ typedef struct {
|
|||
%type <def> var_def_item var_def_list
|
||||
%type <def> func_def_item func_def_list
|
||||
%type <expr> const opt_expr expr arg_list element_list element_list1 element
|
||||
%type <expr> string_val
|
||||
%type <expr> statement statements statement_block
|
||||
%type <expr> break_label continue_label enum_list enum
|
||||
%type <function> begin_function
|
||||
|
@ -832,11 +833,10 @@ const
|
|||
$$->type = ex_float;
|
||||
$$->e.float_val = $1;
|
||||
}
|
||||
| STRING_VAL
|
||||
| string_val
|
||||
{
|
||||
$$ = new_expr ();
|
||||
$$->type = ex_string;
|
||||
$$->e.string_val = $1;
|
||||
printf ("'%s'\n", $$->e.string_val);
|
||||
$$ = $1;
|
||||
}
|
||||
| VECTOR_VAL
|
||||
{
|
||||
|
@ -863,6 +863,22 @@ const
|
|||
}
|
||||
;
|
||||
|
||||
string_val
|
||||
: STRING_VAL
|
||||
{
|
||||
$$ = new_expr ();
|
||||
$$->type = ex_string;
|
||||
$$->e.string_val = $1;
|
||||
}
|
||||
| string_val STRING_VAL
|
||||
{
|
||||
expr_t *e = new_expr ();
|
||||
e->type = ex_string;
|
||||
e->e.string_val = $2;
|
||||
$$ = binary_expr ('+', $1, e);
|
||||
}
|
||||
;
|
||||
|
||||
%%
|
||||
|
||||
type_t *
|
||||
|
|
Loading…
Reference in a new issue