Formatting. (No functional changes.)

This commit is contained in:
Jeff Young 2022-10-13 12:07:50 +01:00
parent d6f8ca9a2e
commit 390069cee9
1 changed files with 71 additions and 65 deletions

View File

@ -195,15 +195,19 @@ NUMERIC_EVALUATOR::Token NUMERIC_EVALUATOR::getToken()
if( m_token.pos >= m_token.inputLen )
return retval;
auto isDecimalSeparator = [ & ]( char ch ) -> bool {
auto isDecimalSeparator =
[&]( char ch ) -> bool
{
return ( ch == m_localeDecimalSeparator || ch == '.' || ch == ',' );
};
// Lambda: get value as string, store into clToken.token and update current index.
auto extractNumber = [ & ]() {
auto extractNumber =
[&]()
{
bool haveSeparator = false;
idx = 0;
auto ch = m_token.input[ m_token.pos ];
char ch = m_token.input[ m_token.pos ];
do
{
@ -230,7 +234,9 @@ NUMERIC_EVALUATOR::Token NUMERIC_EVALUATOR::getToken()
// Lamda: Get unit for current token.
// 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 ];
if( ch == '"' )
@ -304,7 +310,7 @@ NUMERIC_EVALUATOR::Token NUMERIC_EVALUATOR::getToken()
retval.token = VALUE;
retval.value.dValue = atof( m_token.token );
}
else if(( convertFrom = checkUnit()) != Unit::Invalid )
else if( ( convertFrom = checkUnit() ) != Unit::Invalid )
{
// UNIT
// 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
const char* cptr = &m_token.input[ m_token.pos ];