82 |
|
for ( ; true; ichToken += cchToken) { |
83 |
|
if (lookingAtLeadingWhitespace()) |
84 |
|
continue; |
85 |
< |
if (lookingAtComment()) |
86 |
< |
continue; |
85 |
> |
//if (lookingAtComment()) |
86 |
> |
// continue; |
87 |
|
bool endOfLine = lookingAtEndOfLine(); |
88 |
|
if (endOfLine || lookingAtEndOfStatement()) { |
89 |
|
if (tokCommand != Token::nada) { |
131 |
|
} |
132 |
|
|
133 |
|
if (lookingAtLookupToken()) { |
134 |
< |
std::string ident = script.substr(ichToken, ichToken + cchToken); |
135 |
< |
|
134 |
> |
std::string ident = script.substr(ichToken, cchToken); |
135 |
|
Token token; |
136 |
|
Token* pToken = TokenMap::getInstance()->getToken(ident); |
137 |
|
if (pToken != NULL) { |
418 |
|
return false; |
419 |
|
} |
420 |
|
case '?': // include question marks in identifier for atom expressions |
421 |
< |
while (ichT < cchScript && (std::isalpha(ch = script[ichT]) ||std::isdigit(ch) || |
422 |
< |
ch == '_' || ch == '?') ||(ch == '^' && ichT > ichToken && std::isdigit(script[ichT - 1]))) { |
423 |
< |
// hack for insertion codes embedded in an atom expression :-( |
425 |
< |
// select c3^a |
421 |
> |
while (ichT < cchScript && !std::isspace(ch = script[ichT]) && (std::isalpha(ch) ||std::isdigit(ch) || |
422 |
> |
ch == '_' || ch == '?') ) { |
423 |
> |
|
424 |
|
++ichT; |
425 |
|
} |
426 |
|
break; |
595 |
|
} |
596 |
|
|
597 |
|
Token tokenValue = tokenNext(); |
598 |
< |
if (tokenValue.tok != Token::integer) { |
599 |
< |
return integerExpected(); |
598 |
> |
if (tokenValue.tok != Token::integer && tokenValue.tok != Token::decimal) { |
599 |
> |
return numberExpected(); |
600 |
|
} |
601 |
< |
int val = tokenValue.intValue; |
602 |
< |
// note that a comparator instruction is a complicated instruction |
603 |
< |
// int intValue is the tok of the property you are comparing |
604 |
< |
// the value against which you are comparing is stored as an Integer |
605 |
< |
// in the object value |
601 |
> |
|
602 |
> |
float val; |
603 |
> |
if (tokenValue.value.type() == typeid(int)) { |
604 |
> |
val = boost::any_cast<int>(tokenValue.value); |
605 |
> |
} else if (tokenValue.value.type() == typeid(float)) { |
606 |
> |
val = boost::any_cast<float>(tokenValue.value); |
607 |
> |
} else { |
608 |
> |
return false; |
609 |
> |
} |
610 |
> |
|
611 |
|
return addTokenToPostfix(Token(tokenComparator.tok, |
612 |
|
tokenAtomProperty.tok, boost::any(val))); |
613 |
|
} |
657 |
|
tok = tokPeek(); |
658 |
|
//allow two dot at most |
659 |
|
if (tok == Token::dot) { |
660 |
+ |
tokenNext(); |
661 |
+ |
chemObjName += "."; |
662 |
|
if (!clauseName(chemObjName)) { |
663 |
|
return false; |
664 |
|
} |
665 |
|
tok = tokPeek(); |
666 |
|
if (tok == Token::dot) { |
667 |
+ |
tokenNext(); |
668 |
+ |
chemObjName += "."; |
669 |
+ |
|
670 |
|
if (!clauseName(chemObjName)) { |
671 |
|
return false; |
672 |
|
} |