mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-30 20:50:42 +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> var_def_item var_def_list
|
||||||
%type <def> func_def_item func_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> const opt_expr expr arg_list element_list element_list1 element
|
||||||
|
%type <expr> string_val
|
||||||
%type <expr> statement statements statement_block
|
%type <expr> statement statements statement_block
|
||||||
%type <expr> break_label continue_label enum_list enum
|
%type <expr> break_label continue_label enum_list enum
|
||||||
%type <function> begin_function
|
%type <function> begin_function
|
||||||
|
@ -832,11 +833,10 @@ const
|
||||||
$$->type = ex_float;
|
$$->type = ex_float;
|
||||||
$$->e.float_val = $1;
|
$$->e.float_val = $1;
|
||||||
}
|
}
|
||||||
| STRING_VAL
|
| string_val
|
||||||
{
|
{
|
||||||
$$ = new_expr ();
|
printf ("'%s'\n", $$->e.string_val);
|
||||||
$$->type = ex_string;
|
$$ = $1;
|
||||||
$$->e.string_val = $1;
|
|
||||||
}
|
}
|
||||||
| VECTOR_VAL
|
| 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 *
|
type_t *
|
||||||
|
|
Loading…
Reference in a new issue