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

Function three_arguments

src/test.c:586–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

584}
585
586static bool
587three_arguments (void)
588{
589 bool value;
590 int bop = binop (argv[pos + 1]);
591
592 if (0 <= bop)
593 value = binary_operator (false, bop);
594 else if (streq (argv[pos], "!"))
595 {
596 advance (true);
597 value = !two_arguments ();
598 }
599 else if (streq (argv[pos], "(") && streq (argv[pos + 2], ")"))
600 {
601 advance (false);
602 value = one_argument ();
603 advance (false);
604 }
605 else if (streq (argv[pos + 1], "-a") || streq (argv[pos + 1], "-o")
606 || streq (argv[pos + 1], ">") || streq (argv[pos + 1], "<"))
607 value = expr ();
608 else
609 test_syntax_error (_("%s: binary operator expected"),
610 quote (argv[pos + 1]));
611 return (value);
612}
613
614/* This is an implementation of a Posix.2 proposal by David Korn. */
615static bool

Callers 1

posixtestFunction · 0.85

Calls 7

binary_operatorFunction · 0.85
advanceFunction · 0.85
two_argumentsFunction · 0.85
one_argumentFunction · 0.85
exprFunction · 0.85
test_syntax_errorFunction · 0.85
binopFunction · 0.70

Tested by

no test coverage detected