1704 |
} |
} |
1705 |
|
|
1706 |
/** |
/** |
|
* Convenience function used for retrieving the data type of a script |
|
|
* variable name being passed to this function. |
|
|
* |
|
|
* @param name - some script variable name (e.g. "$foo") |
|
|
* @return variable's data type (e.g. INT_EXPR for example above) |
|
|
*/ |
|
|
inline ExprType_t exprTypeOfVarName(const String& name) { |
|
|
if (name.empty()) return (ExprType_t) -1; |
|
|
const char prefix = name[0]; |
|
|
switch (prefix) { |
|
|
case '$': return INT_EXPR; |
|
|
case '%': return INT_ARR_EXPR; |
|
|
case '~': return REAL_EXPR; |
|
|
case '?': return REAL_ARR_EXPR; |
|
|
case '@': return STRING_EXPR; |
|
|
case '!': return STRING_ARR_EXPR; |
|
|
} |
|
|
return (ExprType_t) -1; |
|
|
} |
|
|
|
|
|
/** |
|
1707 |
* Returns @c true in case the passed data type is some array data type. |
* Returns @c true in case the passed data type is some array data type. |
1708 |
*/ |
*/ |
1709 |
inline bool isArray(const ExprType_t& type) { |
inline bool isArray(const ExprType_t& type) { |