Lines Matching refs:CurPtr
25 CurPtr = nullptr;
37 CurPtr = ptr;
39 CurPtr = CurBuf.begin();
53 char CurChar = *CurPtr++;
60 if (CurPtr - 1 != CurBuf.end())
64 --CurPtr; // Another call to lex will return EOF again.
76 while (isdigit(*CurPtr))
77 ++CurPtr;
82 if (*CurPtr == 'e' || *CurPtr == 'E') {
83 ++CurPtr;
84 if (*CurPtr == '-' || *CurPtr == '+')
85 ++CurPtr;
86 while (isdigit(*CurPtr))
87 ++CurPtr;
91 StringRef(TokStart, CurPtr - TokStart));
101 assert((*CurPtr == 'p' || *CurPtr == 'P' || *CurPtr == '.') &&
106 if (*CurPtr == '.') {
107 ++CurPtr;
109 const char *FracStart = CurPtr;
110 while (isxdigit(*CurPtr))
111 ++CurPtr;
113 NoFracDigits = CurPtr == FracStart;
121 if (*CurPtr != 'p' && *CurPtr != 'P')
124 ++CurPtr;
126 if (*CurPtr == '+' || *CurPtr == '-')
127 ++CurPtr;
130 const char *ExpStart = CurPtr;
131 while (isdigit(*CurPtr))
132 ++CurPtr;
134 if (CurPtr == ExpStart)
138 return AsmToken(AsmToken::Real, StringRef(TokStart, CurPtr - TokStart));
148 if (CurPtr[-1] == '.' && isdigit(*CurPtr)) {
150 while (isdigit(*CurPtr))
151 ++CurPtr;
152 if (*CurPtr == 'e' || *CurPtr == 'E' ||
153 !IsIdentifierChar(*CurPtr, AllowAtInIdentifier))
157 while (IsIdentifierChar(*CurPtr, AllowAtInIdentifier))
158 ++CurPtr;
161 if (CurPtr == TokStart+1 && TokStart[0] == '.')
164 return AsmToken(AsmToken::Identifier, StringRef(TokStart, CurPtr - TokStart));
170 switch (*CurPtr) {
172 case '/': return ++CurPtr, LexLineComment();
173 default: return AsmToken(AsmToken::Slash, StringRef(CurPtr-1, 1));
177 ++CurPtr; // skip the star.
185 if (CurPtr[0] != '/') break;
187 ++CurPtr; // End the */.
207 static void SkipIgnoredIntegerSuffix(const char *&CurPtr) {
209 if (CurPtr[0] == 'U')
210 ++CurPtr;
211 if (CurPtr[0] == 'L')
212 ++CurPtr;
213 if (CurPtr[0] == 'L')
214 ++CurPtr;
219 static unsigned doLookAhead(const char *&CurPtr, unsigned DefaultRadix) {
221 const char *LookAhead = CurPtr;
234 CurPtr = isHex || !FirstHex ? LookAhead : FirstHex;
256 if (CurPtr[-1] != '0' || CurPtr[0] == '.') {
257 unsigned Radix = doLookAhead(CurPtr, 10);
260 if (!isHex && (*CurPtr == '.' || *CurPtr == 'e')) {
261 ++CurPtr;
265 StringRef Result(TokStart, CurPtr - TokStart);
274 ++CurPtr;
278 SkipIgnoredIntegerSuffix(CurPtr);
283 if (*CurPtr == 'b') {
284 ++CurPtr;
286 if (!isdigit(CurPtr[0])) {
287 --CurPtr;
288 StringRef Result(TokStart, CurPtr - TokStart);
291 const char *NumStart = CurPtr;
292 while (CurPtr[0] == '0' || CurPtr[0] == '1')
293 ++CurPtr;
296 if (CurPtr == NumStart)
299 StringRef Result(TokStart, CurPtr - TokStart);
307 SkipIgnoredIntegerSuffix(CurPtr);
312 if (*CurPtr == 'x') {
313 ++CurPtr;
314 const char *NumStart = CurPtr;
315 while (isxdigit(CurPtr[0]))
316 ++CurPtr;
320 if (CurPtr[0] == '.' || CurPtr[0] == 'p' || CurPtr[0] == 'P')
321 return LexHexFloatLiteral(NumStart == CurPtr);
324 if (CurPtr == NumStart)
325 return ReturnError(CurPtr-2, "invalid hexadecimal number");
328 if (StringRef(TokStart, CurPtr - TokStart).getAsInteger(0, Result))
332 if (*CurPtr == 'h' || *CurPtr == 'H')
333 ++CurPtr;
337 SkipIgnoredIntegerSuffix(CurPtr);
339 return intToken(StringRef(TokStart, CurPtr - TokStart), Result);
344 unsigned Radix = doLookAhead(CurPtr, 8);
346 StringRef Result(TokStart, CurPtr - TokStart);
353 ++CurPtr;
357 SkipIgnoredIntegerSuffix(CurPtr);
379 StringRef Res = StringRef(TokStart,CurPtr - TokStart);
414 return AsmToken(AsmToken::String, StringRef(TokStart, CurPtr - TokStart));
418 TokStart = CurPtr;
420 while (!isAtStartOfComment(CurPtr) && // Start of line comment.
421 !isAtStatementSeparator(CurPtr) && // End of statement marker.
422 *CurPtr != '\n' && *CurPtr != '\r' &&
423 (*CurPtr != 0 || CurPtr != CurBuf.end())) {
424 ++CurPtr;
426 return StringRef(TokStart, CurPtr-TokStart);
430 TokStart = CurPtr;
432 while (*CurPtr != '\n' && *CurPtr != '\r' &&
433 (*CurPtr != 0 || CurPtr != CurBuf.end())) {
434 ++CurPtr;
436 return StringRef(TokStart, CurPtr-TokStart);
442 const char *SavedCurPtr = CurPtr;
465 CurPtr = SavedCurPtr;
490 TokStart = CurPtr;
504 CurPtr += strlen(MAI.getSeparatorString()) - 1;
534 while (*CurPtr==' ' || *CurPtr=='\t') {
535 CurPtr++;
560 if (*CurPtr == '=')
561 return ++CurPtr, AsmToken(AsmToken::EqualEqual, StringRef(TokStart, 2));
564 if (*CurPtr == '|')
565 return ++CurPtr, AsmToken(AsmToken::PipePipe, StringRef(TokStart, 2));
569 if (*CurPtr == '&')
570 return ++CurPtr, AsmToken(AsmToken::AmpAmp, StringRef(TokStart, 2));
573 if (*CurPtr == '=')
574 return ++CurPtr, AsmToken(AsmToken::ExclaimEqual, StringRef(TokStart, 2));
585 switch (*CurPtr) {
586 case '<': return ++CurPtr, AsmToken(AsmToken::LessLess,
588 case '=': return ++CurPtr, AsmToken(AsmToken::LessEqual,
590 case '>': return ++CurPtr, AsmToken(AsmToken::LessGreater,
595 switch (*CurPtr) {
596 case '>': return ++CurPtr, AsmToken(AsmToken::GreaterGreater,
598 case '=': return ++CurPtr, AsmToken(AsmToken::GreaterEqual,