Lines Matching +defs:value +defs:sub
74 * Variables are set using lines of the form VAR=value. Both the variable
75 * name and the value can contain references to other variables, by using
80 * Var_SetExpand Set the value of the variable, creating it if
86 * necessary. A space is placed between the old value and
93 * Var_Value Return the unexpanded value of a variable, or NULL if
134 * Variables are defined using one of the VAR=value assignments. Their
135 * value can be queried by expressions such as $V, ${VAR}, or with modifiers
161 /* The unexpanded value of the variable. */
176 * Appending to its value depends on the scope, see var-op-append.mk.
181 * The variable value cannot be changed anymore, and the variable
271 const FStr *value;
284 * Special return value for Var_Parse, indicating a parse error. It may be
291 * Special return value for Var_Parse, indicating an undefined variable in
351 EvalStack_Push(EvalStackElementKind kind, const char *str, const FStr *value)
360 evalStack.elems[evalStack.len].value = value;
388 const char* value = elem->value != NULL
390 ? elem->value->str : NULL;
393 value != NULL ? "\" with value \"" : "",
394 value != NULL ? value : "");
399 VarNew(FStr name, const char *value,
402 size_t value_len = strlen(value);
406 Buf_AddBytes(&var->val, value, value_len);
519 /* If the variable is short-lived, free it, including its value. */
532 ValueDescription(const char *value)
534 if (value[0] == '\0')
536 if (ch_isspace(value[strlen(value) - 1]))
541 /* Add a new variable of the given name and value to the given scope. */
543 VarAdd(const char *name, const char *value, GNode *scope, VarSetFlags flags)
546 Var *v = VarNew(FStr_InitRefer(/* aliased to */ he->key), value,
550 scope->name, name, value, ValueDescription(value));
570 v = he->value;
608 Var *v = hi.entry->value;
786 * children see a correctly incremented value.
801 Var *var = hi.entry->value;
995 /* Set the variable to the value; the name is not expanded. */
1035 * wrong value.
1118 * replace its value.
1141 Global_Set(const char *name, const char *value)
1143 Var_Set(SCOPE_GLOBAL, name, value);
1153 Global_Set_ReadOnly(const char *name, const char *value)
1155 Var_SetWithFlags(SCOPE_GLOBAL, name, value, VAR_SET_NONE);
1160 * Append the value to the named variable.
1163 * and the given value are appended.
1202 * scope, add a space and the value, otherwise set the variable to the value.
1228 Global_Append(const char *name, const char *value)
1230 Var_Append(SCOPE_GLOBAL, name, value);
1265 * Return the unexpanded value of the given variable in the given scope,
1273 * The value if the variable exists, NULL if it doesn't.
1274 * The value is valid until the next modification to any variable.
1280 char *value;
1288 value = v->val.data;
1292 return FStr_InitOwn(value);
1311 * Return the unexpanded variable value from this node, without trying to look
1387 SepBuf_AddSubstring(SepBuf *buf, Substring sub)
1389 SepBuf_AddRange(buf, sub.start, sub.end);
1916 * parsing the modifier, evaluating it and finally updating the value of the
1950 * only noticeable effect is that they update the value of the expression.
1953 * Evaluating the modifier usually takes the current value of the
1954 * expression from ch->expr->value, or the variable name from ch->var->name,
1955 * and stores the result back in ch->expr->value via Expr_SetValueOwn or
1994 FStr value;
2032 * Whether some modifiers that otherwise split the variable value
2033 * into words, like :S and :C, treat the variable value as a single
2049 return expr->value.str;
2059 Expr_SetValue(Expr *expr, FStr value)
2061 FStr_Done(&expr->value);
2062 expr->value = value;
2066 Expr_SetValueOwn(Expr *expr, char *value)
2068 Expr_SetValue(expr, FStr_InitOwn(value));
2072 Expr_SetValueRefer(Expr *expr, const char *value)
2074 Expr_SetValue(expr, FStr_InitRefer(value));
2236 Substring sub = LazyBuf_Get(part);
2238 (int)Substring_Length(sub), sub.start);
2415 /* XXX: Consider restoring the previous value instead of deleting. */
2554 "Invalid time value \"%s\"", arg.str);
3521 * The ::= modifiers are special in that they do not read the variable value
3535 * ::=<str> Assigns <str> as the new value of variable.
3536 * ::?=<str> Assigns <str> as value of variable if
3539 * ::!=<cmd> Assigns output of <cmd> as the new value of
3607 * remember current value
3641 * Apply the given function to each word of the variable value,
3817 "Evaluating modifier ${%s:%c%s} on value \"%s\"\n",
3824 "Evaluating modifier ${%s:%c%s} on value \"%s\" (%s, %s)\n",
3833 const char *value = Expr_Str(expr);
3834 const char *quot = value == var_Error ? "" : "\"";
3839 quot, value == var_Error ? "error" : value, quot);
3845 quot, value == var_Error ? "error" : value, quot,
4054 /* Apply any modifiers (such as :Mpattern or :@var@loop@ or :Q or ::=value). */
4436 * instead of the actually computed value.
4453 #define Expr_Init(name, value, emode, scope, defined) \
4454 (Expr) { name, value, emode, scope, defined }
4457 Expr_Init(const char *name, FStr value,
4463 expr.value = value;
4472 * Expressions of the form ${:U...} with a trivial value are often generated
4501 * the modifiers to the value of the expression.
4512 * TODO: After a parse error, the value of *pp is
4517 * return The value of the expression, never NULL.
4591 * FIXME: This assignment creates an alias to the current value of the
4592 * variable. This means that as long as the value of the expression
4593 * stays the same, the value of the variable must not change, and the
4596 * while its value is still being used:
4598 * VAR= value
4604 * At the bottom of this function, the resulting value is compared to
4605 * the then-current value of the variable. This might also invoke
4608 expr.value = FStr_InitRefer(v->val.data);
4613 EvalStack_Push(VSK_VARNAME, expr.name, &expr.value);
4615 EvalStack_Push(VSK_EXPR, start, &expr.value);
4619 * the variable value.
4658 if (expr.value.str == v->val.data) {
4660 expr.value.freeIt = v->val.data;
4667 return expr.value;