Spreadsheet: Fixed issue #2894: Unit strings could be used as aliases.
This commit is contained in:
committed by
Yorik van Havre
parent
31b0233393
commit
2714dd82c8
@@ -1934,3 +1934,16 @@ bool ExpressionParser::isTokenAnIndentifier(const std::string & str)
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ExpressionParser::isTokenAUnit(const std::string & str)
|
||||
{
|
||||
ExpressionParser::YY_BUFFER_STATE buf = ExpressionParser_scan_string(str.c_str());
|
||||
int token = ExpressionParserlex();
|
||||
int status = ExpressionParserlex();
|
||||
ExpressionParser_delete_buffer(buf);
|
||||
|
||||
if (status == 0 && token == UNIT)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -481,6 +481,7 @@ AppExport Expression * parse(const App::DocumentObject *owner, const char *buffe
|
||||
AppExport UnitExpression * parseUnit(const App::DocumentObject *owner, const char *buffer);
|
||||
AppExport ObjectIdentifier parsePath(const App::DocumentObject *owner, const char* buffer);
|
||||
AppExport bool isTokenAnIndentifier(const std::string & str);
|
||||
AppExport bool isTokenAUnit(const std::string & str);
|
||||
AppExport std::vector<boost::tuple<int, int, std::string> > tokenize(const std::string & str);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user