| 52 | } |
| 53 | |
| 54 | static 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 |
no test coverage detected