MCPcopy Create free account
hub / github.com/bumptop/BumpTop / getChar

Function getChar

trunk/win/Source/LUpdateString/cpp.cpp:132–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130static int yyInPos;
131
132static uint getChar()
133{
134 forever {
135 if (yyInPos >= yyInStr.size())
136 return EOF;
137 uint c = yyInStr[yyInPos++].unicode();
138 if (c == '\\' && yyInPos < yyInStr.size()) {
139 if (yyInStr[yyInPos].unicode() == '\n') {
140 ++yyCurLineNo;
141 ++yyInPos;
142 continue;
143 }
144 if (yyInStr[yyInPos].unicode() == '\r') {
145 ++yyCurLineNo;
146 ++yyInPos;
147 if (yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n')
148 ++yyInPos;
149 continue;
150 }
151 }
152 if (c == '\r') {
153 if (yyInPos < yyInStr.size() && yyInStr[yyInPos].unicode() == '\n')
154 ++yyInPos;
155 c = '\n';
156 ++yyCurLineNo;
157 } else if (c == '\n') {
158 ++yyCurLineNo;
159 }
160 return c;
161 }
162}
163
164static Token getToken()

Callers 3

getTokenFunction · 0.70
fetchtrInlinedCppFunction · 0.70
loadCPPFunction · 0.70

Calls 2

sizeMethod · 0.45
unicodeMethod · 0.45

Tested by

no test coverage detected