aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/llvm12/lib/TableGen/TGLexer.cpp
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:30 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:30 +0300
commit2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch)
tree012bb94d777798f1f56ac1cec429509766d05181 /contrib/libs/llvm12/lib/TableGen/TGLexer.cpp
parent6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff)
downloadydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/TableGen/TGLexer.cpp')
-rw-r--r--contrib/libs/llvm12/lib/TableGen/TGLexer.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/contrib/libs/llvm12/lib/TableGen/TGLexer.cpp b/contrib/libs/llvm12/lib/TableGen/TGLexer.cpp
index 94c79102c7..fd0f9ff7af 100644
--- a/contrib/libs/llvm12/lib/TableGen/TGLexer.cpp
+++ b/contrib/libs/llvm12/lib/TableGen/TGLexer.cpp
@@ -150,7 +150,7 @@ tgtok::TokKind TGLexer::LexToken(bool FileOrLineStart) {
case EOF:
// Lex next token, if we just left an include file.
// Note that leaving an include file means that the next
- // symbol is located at the end of the 'include "..."'
+ // symbol is located at the end of the 'include "..."'
// construct, so LexToken() is called with default
// false parameter.
if (processEOF())
@@ -180,19 +180,19 @@ tgtok::TokKind TGLexer::LexToken(bool FileOrLineStart) {
return tgtok::paste;
- // The period is a separate case so we can recognize the "..."
- // range punctuator.
- case '.':
- if (peekNextChar(0) == '.') {
- ++CurPtr; // Eat second dot.
- if (peekNextChar(0) == '.') {
- ++CurPtr; // Eat third dot.
- return tgtok::dotdotdot;
- }
- return ReturnError(TokStart, "Invalid '..' punctuation");
- }
- return tgtok::dot;
-
+ // The period is a separate case so we can recognize the "..."
+ // range punctuator.
+ case '.':
+ if (peekNextChar(0) == '.') {
+ ++CurPtr; // Eat second dot.
+ if (peekNextChar(0) == '.') {
+ ++CurPtr; // Eat third dot.
+ return tgtok::dotdotdot;
+ }
+ return ReturnError(TokStart, "Invalid '..' punctuation");
+ }
+ return tgtok::dot;
+
case '\r':
PrintFatalError("getNextChar() must never return '\r'");
return tgtok::Error;
@@ -338,7 +338,7 @@ tgtok::TokKind TGLexer::LexIdentifier() {
while (isalpha(*CurPtr) || isdigit(*CurPtr) || *CurPtr == '_')
++CurPtr;
- // Check to see if this identifier is a reserved keyword.
+ // Check to see if this identifier is a reserved keyword.
StringRef Str(IdentStart, CurPtr-IdentStart);
tgtok::TokKind Kind = StringSwitch<tgtok::TokKind>(Str)
@@ -351,8 +351,8 @@ tgtok::TokKind TGLexer::LexIdentifier() {
.Case("dag", tgtok::Dag)
.Case("class", tgtok::Class)
.Case("def", tgtok::Def)
- .Case("true", tgtok::TrueVal)
- .Case("false", tgtok::FalseVal)
+ .Case("true", tgtok::TrueVal)
+ .Case("false", tgtok::FalseVal)
.Case("foreach", tgtok::Foreach)
.Case("defm", tgtok::Defm)
.Case("defset", tgtok::Defset)
@@ -361,25 +361,25 @@ tgtok::TokKind TGLexer::LexIdentifier() {
.Case("let", tgtok::Let)
.Case("in", tgtok::In)
.Case("defvar", tgtok::Defvar)
- .Case("include", tgtok::Include)
+ .Case("include", tgtok::Include)
.Case("if", tgtok::If)
.Case("then", tgtok::Then)
.Case("else", tgtok::ElseKW)
- .Case("assert", tgtok::Assert)
+ .Case("assert", tgtok::Assert)
.Default(tgtok::Id);
- // A couple of tokens require special processing.
- switch (Kind) {
- case tgtok::Include:
- if (LexInclude()) return tgtok::Error;
- return Lex();
- case tgtok::Id:
- CurStrVal.assign(Str.begin(), Str.end());
- break;
- default:
- break;
- }
-
+ // A couple of tokens require special processing.
+ switch (Kind) {
+ case tgtok::Include:
+ if (LexInclude()) return tgtok::Error;
+ return Lex();
+ case tgtok::Id:
+ CurStrVal.assign(Str.begin(), Str.end());
+ break;
+ default:
+ break;
+ }
+
return Kind;
}
@@ -541,7 +541,7 @@ tgtok::TokKind TGLexer::LexBracket() {
}
}
- return ReturnError(CodeStart - 2, "Unterminated code block");
+ return ReturnError(CodeStart - 2, "Unterminated code block");
}
/// LexExclaim - Lex '!' and '![a-zA-Z]+'.
@@ -571,12 +571,12 @@ tgtok::TokKind TGLexer::LexExclaim() {
.Case("con", tgtok::XConcat)
.Case("dag", tgtok::XDag)
.Case("add", tgtok::XADD)
- .Case("sub", tgtok::XSUB)
+ .Case("sub", tgtok::XSUB)
.Case("mul", tgtok::XMUL)
- .Case("not", tgtok::XNOT)
+ .Case("not", tgtok::XNOT)
.Case("and", tgtok::XAND)
.Case("or", tgtok::XOR)
- .Case("xor", tgtok::XXOR)
+ .Case("xor", tgtok::XXOR)
.Case("shl", tgtok::XSHL)
.Case("sra", tgtok::XSRA)
.Case("srl", tgtok::XSRL)
@@ -585,14 +585,14 @@ tgtok::TokKind TGLexer::LexExclaim() {
.Case("subst", tgtok::XSubst)
.Case("foldl", tgtok::XFoldl)
.Case("foreach", tgtok::XForEach)
- .Case("filter", tgtok::XFilter)
+ .Case("filter", tgtok::XFilter)
.Case("listconcat", tgtok::XListConcat)
.Case("listsplat", tgtok::XListSplat)
.Case("strconcat", tgtok::XStrConcat)
- .Case("interleave", tgtok::XInterleave)
- .Case("substr", tgtok::XSubstr)
- .Cases("setdagop", "setop", tgtok::XSetDagOp) // !setop is deprecated.
- .Cases("getdagop", "getop", tgtok::XGetDagOp) // !getop is deprecated.
+ .Case("interleave", tgtok::XInterleave)
+ .Case("substr", tgtok::XSubstr)
+ .Cases("setdagop", "setop", tgtok::XSetDagOp) // !setop is deprecated.
+ .Cases("getdagop", "getop", tgtok::XGetDagOp) // !getop is deprecated.
.Default(tgtok::Error);
return Kind != tgtok::Error ? Kind : ReturnError(Start-1, "Unknown operator");