Changeset 40236
- Timestamp:
- Dec 3, 2017, 5:56:57 AM (9 years ago)
- Location:
- branches/eam_branches/ohana.20170822/src/opihi/lib.shell
- Files:
-
- 3 edited
-
convert_to_RPN.c (modified) (2 diffs)
-
dvomath.c (modified) (1 diff)
-
evaluate_stack.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ohana.20170822/src/opihi/lib.shell/convert_to_RPN.c
r39558 r40236 120 120 Nop_stack ++; 121 121 break; 122 case ST_UNARY:123 122 case ST_BINARY: 124 123 case ST_TRINARY: … … 139 138 Nop_stack ++; 140 139 break; 140 case ST_UNARY: 141 141 case ST_LEFT: 142 142 /* push operator on OP stack */ -
branches/eam_branches/ohana.20170822/src/opihi/lib.shell/dvomath.c
r40168 r40236 29 29 unsigned int Ncstack; 30 30 cstack = isolate_elements (argc, argv, &Ncstack); 31 32 // for (i = 0; i < Ncstack; i++) { 33 // fprintf (stderr, "%d : %s\n", i, cstack[i]); 34 // } 31 35 32 36 /* generate RPN stack from cstack arguments */ -
branches/eam_branches/ohana.20170822/src/opihi/lib.shell/evaluate_stack.c
r40212 r40236 110 110 111 111 if (i < 3) { /* need two variables to operate on */ 112 snprintf (line, 512, "syntax error: trinary operator without three operands: %s\n ", stack[i].name);112 snprintf (line, 512, "syntax error: trinary operator without three operands: %s\n(Note that the : in a trinary operation must be protected by spaces", stack[i].name); 113 113 push_error (line); 114 114 clear_stack (&tmp_stack); … … 124 124 125 125 /* there are no valid unary string operators */ 126 snprintf (line, 512, "invalid operands for trinary operator %s (mismatch types?) ", stack[i].name);126 snprintf (line, 512, "invalid operands for trinary operator %s (mismatch types?)\n(Note that the : in a trinary operation must be protected by spaces)", stack[i].name); 127 127 push_error (line); 128 128 clear_stack (&tmp_stack); … … 131 131 got_three_op: 132 132 if (!status) { 133 snprintf (line, 512, "syntax error: invalid operand for trinary operation: %s or %s or %s\n ", stack[i-1].name, stack[i-2].name, stack[i-3].name);133 snprintf (line, 512, "syntax error: invalid operand for trinary operation: %s or %s or %s\n(Note that the : in a trinary operation must be protected by spaces)", stack[i-1].name, stack[i-2].name, stack[i-3].name); 134 134 push_error (line); 135 135 clear_stack (&tmp_stack);
Note:
See TracChangeset
for help on using the changeset viewer.
