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

Function SetNumericConstantState

scintilla/lexers/LexCLW.cxx:114–142  ·  view source on GitHub ↗

Set the correct numeric constant state

Source from the content-addressed store, hash-verified

112
113// Set the correct numeric constant state
114inline bool SetNumericConstantState(StyleContext &scDoc) {
115
116 int iPoints = 0; // Point counter
117 char cNumericString[512]; // Numeric string buffer
118
119 // Buffer the current numberic string
120 scDoc.GetCurrent(cNumericString, sizeof(cNumericString));
121 // Loop through the string until end of string (NULL termination)
122 for (int iIndex = 0; cNumericString[iIndex] != '\0'; iIndex++) {
123 // Depending on the character
124 switch (cNumericString[iIndex]) {
125 // Is a . (point)
126 case '.' :
127 // Increment point counter
128 iPoints++;
129 break;
130 default :
131 break;
132 }
133 }
134 // If points found (can be more than one for improper formatted number
135 if (iPoints > 0) {
136 return(true);
137 }
138 // Else no points found
139 else {
140 return(false);
141 }
142}
143
144// Get the next word in uppercase from the current position (keyword lookahead)
145inline bool GetNextWordUpper(Accessor &styler, unsigned int uiStartPos, int iLength, char *cWord) {

Callers 1

ColouriseClarionDocFunction · 0.85

Calls 1

GetCurrentMethod · 0.80

Tested by

no test coverage detected