added basic support for calling variables and functions from morm::Model objects
This commit is contained in:
@@ -486,7 +486,7 @@ bool PatternParser::IsNameChar(wchar_t c)
|
||||
return ((c>='a' && c<='z') ||
|
||||
(c>='A' && c<='Z') ||
|
||||
(c>='0' && c<='9') ||
|
||||
c=='_' || c=='-' || c=='.' || c=='#' || c=='?');
|
||||
c=='_' || c=='-' || c=='#' || c=='?');
|
||||
}
|
||||
|
||||
|
||||
@@ -622,7 +622,28 @@ return res;
|
||||
}
|
||||
|
||||
|
||||
void PatternParser::ReadFunctionFields(Item::Function & function)
|
||||
{
|
||||
std::wstring field;
|
||||
bool read_next_field = true;
|
||||
|
||||
while( *itext == '.' && read_next_field )
|
||||
{
|
||||
itext += 1;
|
||||
read_next_field = ReadName(field);
|
||||
|
||||
if( read_next_field )
|
||||
{
|
||||
function.fields.emplace_back(field);
|
||||
}
|
||||
}
|
||||
|
||||
if( *itext == ':' )
|
||||
{
|
||||
itext += 1;
|
||||
ReadName(function.postfix); // we allow the postfix to be empty
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool PatternParser::ReadFunction(Item::Function & function, bool with_params)
|
||||
@@ -654,14 +675,12 @@ bool PatternParser::ReadFunction(Item::Function & function, bool with_params)
|
||||
|
||||
if( res )
|
||||
{
|
||||
if( *itext == ':' )
|
||||
{
|
||||
itext += 1;
|
||||
ReadName(function.postfix); // we allow the postfix to be empty
|
||||
}
|
||||
ReadFunctionFields(function);
|
||||
|
||||
if( with_params )
|
||||
{
|
||||
res = ReadParams(function);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user