MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / IsNumberChar

Function IsNumberChar

scintilla/lexers/LexOScript.cxx:54–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54static inline bool IsNumberChar(int ch, int chNext) {
55 // Numeric constructs are not checked for lexical correctness. They are
56 // expected to look like +1.23-E9 but actually any bunch of the following
57 // characters will be styled as number.
58 // KNOWN PROBLEM: if you put + or - operators immediately after a number
59 // and the next operand starts with the letter E, the operator will not be
60 // recognized and it will be styled together with the preceding number.
61 // This should not occur; at least not often. The coding style recommends
62 // putting spaces around operators.
63 return IsADigit(ch) || toupper(ch) == 'E' || ch == '.' ||
64 ((ch == '-' || ch == '+') && toupper(chNext) == 'E');
65}
66
67// This function checks for the start or a natural number without any symbols
68// or operators as a prefix; the IsPrefixedNumberStart should be called

Callers 1

ColouriseOScriptDocFunction · 0.85

Calls 1

IsADigitFunction · 0.85

Tested by

no test coverage detected