mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Merge branch 'tmj-dev' into dev
This commit is contained in:
17
parser.cpp
17
parser.cpp
@@ -110,9 +110,21 @@ cParser::getToken<bool>( bool const ToLower, const char *Break ) {
|
||||
}
|
||||
|
||||
// methods
|
||||
cParser &
|
||||
cParser::autoclear( bool const Autoclear ) {
|
||||
|
||||
m_autoclear = Autoclear;
|
||||
if( mIncludeParser ) { mIncludeParser->autoclear( Autoclear ); }
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool cParser::getTokens(unsigned int Count, bool ToLower, const char *Break)
|
||||
{
|
||||
tokens.clear(); // emulates old parser behaviour. TODO, TBD: allow manual reset?
|
||||
if( true == m_autoclear ) {
|
||||
// legacy parser behaviour
|
||||
tokens.clear();
|
||||
}
|
||||
/*
|
||||
if (LoadTraction==true)
|
||||
trtest="niemaproblema"; //wczytywać
|
||||
@@ -124,7 +136,7 @@ bool cParser::getTokens(unsigned int Count, bool ToLower, const char *Break)
|
||||
this->str("");
|
||||
this->clear();
|
||||
*/
|
||||
for (unsigned int i = 0; i < Count; ++i)
|
||||
for (unsigned int i = tokens.size(); i < Count; ++i)
|
||||
{
|
||||
std::string token = readToken(ToLower, Break);
|
||||
if( true == token.empty() ) {
|
||||
@@ -216,6 +228,7 @@ std::string cParser::readToken( bool ToLower, const char *Break ) {
|
||||
parameter = readToken( false );
|
||||
}
|
||||
mIncludeParser = std::make_shared<cParser>( includefile, buffer_FILE, mPath, LoadTraction, includeparameters );
|
||||
mIncludeParser->autoclear( m_autoclear );
|
||||
if( mIncludeParser->mSize <= 0 ) {
|
||||
ErrorLog( "Bad include: can't open file \"" + includefile + "\"" );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user