MCPcopy Create free account
hub / github.com/coreutils/coreutils / eval7

Function eval7

src/expr.c:641–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

639/* Handle bare operands and ( expr ) syntax. */
640
641static VALUE *
642eval7 (bool evaluate)
643{
644#ifdef EVAL_TRACE
645 trace ("eval7");
646#endif
647 require_more_args ();
648
649 if (nextarg ("("))
650 {
651 VALUE *v = eval (evaluate);
652 if (nomoreargs ())
653 error (EXPR_INVALID, 0, _("syntax error: expecting ')' after %s"),
654 quotearg_n_style (0, locale_quoting_style, *(args - 1)));
655 if (!nextarg (")"))
656 error (EXPR_INVALID, 0, _("syntax error: expecting ')' instead of %s"),
657 quotearg_n_style (0, locale_quoting_style, *args));
658 return v;
659 }
660
661 if (nextarg (")"))
662 error (EXPR_INVALID, 0, _("syntax error: unexpected ')'"));
663
664 return str_value (*args++);
665}
666
667/* Handle match, substr, index, and length keywords, and quoting "+". */
668

Callers 1

eval6Function · 0.85

Calls 6

traceFunction · 0.85
require_more_argsFunction · 0.85
nextargFunction · 0.85
evalFunction · 0.85
nomoreargsFunction · 0.85
str_valueFunction · 0.85

Tested by

no test coverage detected