MCPcopy Create free account
hub / github.com/SpartanJ/eepp / isValidDigitChar

Function isValidDigitChar

src/eepp/system/parsermatcher.cpp:166–179  ·  view source on GitHub ↗

Checks if a character 'c' is a valid digit for the given base. Handles C++ digit separators (') within the main logic, not here.

Source from the content-addressed store, hash-verified

164// Checks if a character 'c' is a valid digit for the given base.
165// Handles C++ digit separators (') within the main logic, not here.
166inline bool isValidDigitChar( char c, int base ) {
167 switch ( base ) {
168 case 2:
169 return isBinaryDigit( c );
170 case 8:
171 return isOctalDigit( c );
172 case 10:
173 return std::isdigit( c );
174 case 16:
175 return std::isxdigit( c );
176 default:
177 return false;
178 }
179}
180
181/*
182 consumeDigitsWithSep

Callers 2

consumeDigitsWithSepFunction · 0.85
isNumberLiteralFunction · 0.85

Calls 2

isBinaryDigitFunction · 0.85
isOctalDigitFunction · 0.85

Tested by

no test coverage detected