Formatting. (No functional changes.)
This commit is contained in:
parent
d6f8ca9a2e
commit
390069cee9
|
@ -195,15 +195,19 @@ NUMERIC_EVALUATOR::Token NUMERIC_EVALUATOR::getToken()
|
||||||
if( m_token.pos >= m_token.inputLen )
|
if( m_token.pos >= m_token.inputLen )
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
auto isDecimalSeparator = [ & ]( char ch ) -> bool {
|
auto isDecimalSeparator =
|
||||||
|
[&]( char ch ) -> bool
|
||||||
|
{
|
||||||
return ( ch == m_localeDecimalSeparator || ch == '.' || ch == ',' );
|
return ( ch == m_localeDecimalSeparator || ch == '.' || ch == ',' );
|
||||||
};
|
};
|
||||||
|
|
||||||
// Lambda: get value as string, store into clToken.token and update current index.
|
// Lambda: get value as string, store into clToken.token and update current index.
|
||||||
auto extractNumber = [ & ]() {
|
auto extractNumber =
|
||||||
|
[&]()
|
||||||
|
{
|
||||||
bool haveSeparator = false;
|
bool haveSeparator = false;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
auto ch = m_token.input[ m_token.pos ];
|
char ch = m_token.input[ m_token.pos ];
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -230,7 +234,9 @@ NUMERIC_EVALUATOR::Token NUMERIC_EVALUATOR::getToken()
|
||||||
|
|
||||||
// Lamda: Get unit for current token.
|
// Lamda: Get unit for current token.
|
||||||
// Valid units are ", in, mm, mil and thou. Returns Unit::Invalid otherwise.
|
// Valid units are ", in, mm, mil and thou. Returns Unit::Invalid otherwise.
|
||||||
auto checkUnit = [ this ]() -> Unit {
|
auto checkUnit =
|
||||||
|
[this]() -> Unit
|
||||||
|
{
|
||||||
char ch = m_token.input[ m_token.pos ];
|
char ch = m_token.input[ m_token.pos ];
|
||||||
|
|
||||||
if( ch == '"' )
|
if( ch == '"' )
|
||||||
|
@ -304,7 +310,7 @@ NUMERIC_EVALUATOR::Token NUMERIC_EVALUATOR::getToken()
|
||||||
retval.token = VALUE;
|
retval.token = VALUE;
|
||||||
retval.value.dValue = atof( m_token.token );
|
retval.value.dValue = atof( m_token.token );
|
||||||
}
|
}
|
||||||
else if(( convertFrom = checkUnit()) != Unit::Invalid )
|
else if( ( convertFrom = checkUnit() ) != Unit::Invalid )
|
||||||
{
|
{
|
||||||
// UNIT
|
// UNIT
|
||||||
// Units are appended to a VALUE.
|
// Units are appended to a VALUE.
|
||||||
|
@ -348,7 +354,7 @@ NUMERIC_EVALUATOR::Token NUMERIC_EVALUATOR::getToken()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( isalpha( ch ))
|
else if( isalpha( ch ) )
|
||||||
{
|
{
|
||||||
// VAR
|
// VAR
|
||||||
const char* cptr = &m_token.input[ m_token.pos ];
|
const char* cptr = &m_token.input[ m_token.pos ];
|
||||||
|
|
Loading…
Reference in New Issue