Changeset 2801 for trunk/Ohana/src/opihi/lib.shell/evaluate_stack.c
- Timestamp:
- Dec 23, 2004, 7:36:01 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/lib.shell/evaluate_stack.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/lib.shell/evaluate_stack.c
r2792 r2801 5 5 6 6 int i, j, Nvar, Nout, status; 7 char line[512]; 7 8 StackVar tmp_stack; 8 9 Nout = Nvar = 0; … … 26 27 return (TRUE); 27 28 } 28 push_error ("syntax error !");29 push_error ("syntax error: not a math expression"); 29 30 free (tmp_stack.name); 30 31 return (FALSE); … … 50 51 51 52 if (i < 2) { /* need two variables to operate on */ 52 fprintf (stderr, "syntax error\n"); 53 sprintf (line, "syntax error: binary operator with one operand: %s\n", stack[i].name); 54 push_error (line); 53 55 free (tmp_stack.name); 54 56 return (FALSE); … … 123 125 124 126 if (i < 1) { /* need one variable to operate on */ 125 fprintf (stderr, "syntax error\n");127 push_error ("syntax error: unary operator with no operand"); 126 128 free (tmp_stack.name); 127 129 return (FALSE); … … 137 139 /* there are no valid unary string operators */ 138 140 if (!strncasecmp (&stack[i - 1].type, "W", 1)) { 139 fprintf (stderr, "syntax error\n");141 push_error ("syntax error: no valid string unary ops"); 140 142 free (tmp_stack.name); 141 143 return (FALSE); … … 156 158 157 159 if (*Nstack > 1) { 158 fprintf (stderr, "syntax error\n");160 push_error ("syntax error in evaluation"); 159 161 return (FALSE); 160 162 }
Note:
See TracChangeset
for help on using the changeset viewer.
