mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
Add new_value_expr().
This simplifies creating a new expression for an arbitrary value object.
This commit is contained in:
parent
42ba0c9d54
commit
b295524385
2 changed files with 16 additions and 0 deletions
|
@ -356,6 +356,13 @@ expr_t *new_temp_def_expr (struct type_s *type);
|
|||
*/
|
||||
expr_t *new_nil_expr (void);
|
||||
|
||||
/** Create a new value expression node.
|
||||
|
||||
\param value The value to put in the expression node.
|
||||
\return The new value expression.
|
||||
*/
|
||||
expr_t *new_value_expr (ex_value_t *value);
|
||||
|
||||
/** Create a new symbol expression node from a name.
|
||||
|
||||
\param name The name for the symbol.
|
||||
|
|
|
@ -496,6 +496,15 @@ new_nil_expr (void)
|
|||
return e;
|
||||
}
|
||||
|
||||
expr_t *
|
||||
new_value_expr (ex_value_t *value)
|
||||
{
|
||||
expr_t *e = new_expr ();
|
||||
e->type = ex_value;
|
||||
e->e.value = value;
|
||||
return e;
|
||||
}
|
||||
|
||||
expr_t *
|
||||
new_name_expr (const char *name)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue