Changeset 3318
- Timestamp:
- Feb 24, 2005, 3:44:00 PM (21 years ago)
- Location:
- trunk/Ohana/src/opihi/lib.shell
- Files:
-
- 3 edited
-
evaluate_stack.c (modified) (3 diffs)
-
isolate_elements.c (modified) (2 diffs)
-
stack_math.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/lib.shell/evaluate_stack.c
r2843 r3318 72 72 TWO_OP ("S","S",SS_binary); 73 73 TWO_OP ("W","W",WW_binary); 74 TWO_OP ("W","S",WW_binary); 75 TWO_OP ("S","W",WW_binary); 74 76 75 77 /* … … 96 98 */ 97 99 98 /* string op number is not valid */100 /* string op number is not valid 99 101 if (!strncasecmp (&stack[i - 2].type, "W", 1) && strncasecmp (&stack[i - 1].type, "W", 1)) { 100 102 free (tmp_stack.name); … … 104 106 free (tmp_stack.name); 105 107 return (FALSE); 106 } 108 } */ 107 109 108 110 if (!status) { -
trunk/Ohana/src/opihi/lib.shell/isolate_elements.c
r3029 r3318 89 89 /* operators */ 90 90 if (negate || minus || posate || plus || (IsAnOp (&in[i][j]) && !SciNotation)) { 91 if (posate) goto skip3;91 if (posate) continue; 92 92 EndOfString (); 93 93 /* copy operator to out[Nout] */ … … 100 100 } 101 101 EndOfString (); 102 continue; 103 } 104 /* quoted string */ 105 if (in[i][j] == '"') { 106 InsertValue (in[i][j]); 107 j++; 108 while ((j < strlen(in[i])) && (in[i][j] != '"')) { 109 InsertValue (in[i][j]); 110 j++; 111 } 112 if (in[i][j] != '"') continue; 113 /* 114 fprintf (stderr, "mismatched quotes\n"); 115 return (FALSE); 116 } 117 */ 118 InsertValue (in[i][j]); 119 EndOfString (); 120 continue; 121 } 122 /* not an operator, not a quoted string */ 123 if (!whitespace (in[i][j])) { 124 InsertValue (in[i][j]); 102 125 } else { 103 if (!whitespace (in[i][j])) { 104 InsertValue (in[i][j]); 105 } else { 106 EndOfString (); 107 } 108 } 109 skip3: 110 continue; 126 EndOfString (); 127 } 111 128 } 112 129 EndOfString (); -
trunk/Ohana/src/opihi/lib.shell/stack_math.c
r3029 r3318 1116 1116 char line[512]; 1117 1117 1118 /* evaluate stack will only call WW_binary with one numerical value, 1119 and only in the case that the string did not parse to a number 1120 thus: string == number -> false */ 1121 if (!strncasecmp (&V1[0].type, "S", 1)) { 1122 value = (op[0] == 'N'); 1123 goto escape; 1124 } 1125 if (!strncasecmp (&V2[0].type, "S", 1)) { 1126 value = (op[0] == 'N'); 1127 goto escape; 1128 } 1129 1118 1130 switch (op[0]) { 1119 1131 case 'E': … … 1124 1136 break; 1125 1137 default: 1126 sprintf (line, "error: op %c not defined !", op[0]);1138 sprintf (line, "error: op %c not defined for string operations!", op[0]); 1127 1139 push_error (line); 1128 1140 return (FALSE); 1129 1141 } 1130 1142 1143 escape: 1131 1144 strcpy (OUT[0].name, "tmp"); 1132 1145 OUT[0].Float = value;
Note:
See TracChangeset
for help on using the changeset viewer.
