Changeset 1465 for trunk/MagicSoft/Mars/mdata
- Timestamp:
- 08/01/02 09:31:18 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mdata
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mdata/MDataChain.cc
r1353 r1465 162 162 { 163 163 int l = txt.Length(); 164 for (int i = 0; i<l; i++) 165 if (!isalnum(txt[i]) && txt[i]!='.' && txt[i]!='-') 164 for (int i=0; i<l; i++) 165 { 166 if (!isalnum(txt[i]) && txt[i]!='.' && 167 ((txt[i]!='-' && txt[i]!='+') || i!=0)) 166 168 return i; 169 } 167 170 168 171 return l; … … 210 213 if (txt=="sgn") return kESgn; 211 214 if (txt[0]=='-') return kENegative; 215 if (txt[0]=='+') return kEPositive; 212 216 213 217 return kENoop; … … 324 328 case '8': 325 329 case '9': 326 if ( txt[0]!='-'|| isdigit(txt[1]) || txt[1]=='.')330 if ((txt[0]!='-' && txt[0]!='+') || isdigit(txt[1]) || txt[1]=='.') 327 331 { 328 332 char *end; … … 360 364 txt = txt.Strip(TString::kBoth); 361 365 362 if ( txt.IsNull() || txt[0]!='(')366 if ((txt.IsNull() || txt[0]!='(') && text[0]!='-' && text[0]!='+') 363 367 { 364 368 newmember = new MDataMember(text.Data()); … … 376 380 377 381 Int_t first = GetBracket(txt); 378 TString sub = op==kENegative ? text.Remove(0,1) + txt : txt(1, first-1);382 TString sub = op==kENegative || op==kEPositive ? text.Remove(0,1) + txt : txt(1, first-1); 379 383 txt.Remove(0, first+1); 380 384 … … 435 439 case kESgn: return val<0 ? -1 : 1; 436 440 case kENegative: return -val; 441 case kEPositive: return val; 437 442 case kENoop: return val; 438 443 } … … 466 471 case kESgn: *fLog << "sgn" << flush; break; 467 472 case kENegative: *fLog << "-" << flush; break; 473 case kEPositive: *fLog << "+" << flush; break; 468 474 case kENoop: 469 475 break; -
trunk/MagicSoft/Mars/mdata/MDataChain.h
r1353 r1465 37 37 kEExp, 38 38 kESgn, 39 kEPositive, 39 40 kENegative 40 41 } OperatorType_t;
Note:
See TracChangeset
for help on using the changeset viewer.