Return the type of S, one of the test command's binary operators. If S is not a binary operator, return -1. */
| 183 | /* Return the type of S, one of the test command's binary operators. |
| 184 | If S is not a binary operator, return -1. */ |
| 185 | static int |
| 186 | binop (char const *s) |
| 187 | { |
| 188 | return ( streq (s, "=" ) ? EQ_STRING_BINOP |
| 189 | : streq (s, "==" ) ? EQ_STRING_BINOP /* an alias for = */ |
| 190 | : streq (s, "!=" ) ? NE_STRING_BINOP |
| 191 | : streq (s, ">" ) ? GT_STRING_BINOP |
| 192 | : streq (s, "<" ) ? LT_STRING_BINOP |
| 193 | : streq (s, "-eq") ? EQ_BINOP |
| 194 | : streq (s, "-ne") ? NE_BINOP |
| 195 | : streq (s, "-lt") ? LT_BINOP |
| 196 | : streq (s, "-le") ? LE_BINOP |
| 197 | : streq (s, "-gt") ? GT_BINOP |
| 198 | : streq (s, "-ge") ? GE_BINOP |
| 199 | : streq (s, "-ot") ? OT_BINOP |
| 200 | : streq (s, "-nt") ? NT_BINOP |
| 201 | : streq (s, "-ef") ? EF_BINOP |
| 202 | : -1); |
| 203 | } |
| 204 | |
| 205 | /* |
| 206 | * term - parse a term and return 1 or 0 depending on whether the term |
no outgoing calls
no test coverage detected