diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-08-09 10:13:40 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-08-09 10:23:09 -0700 |
| commit | 695c2700de54a5fec72ce7214c137a1dc3a02d7b (patch) | |
| tree | 4f549da8c05be186f12442565389d9f3df44c6d7 /source/slang/lexer.cpp | |
| parent | a728612771cdaed66a0bdbfd25f8f250920f0f11 (diff) | |
Major naming overhaul:
- `ExpressionSyntaxNode` becomes `Expr`
- `StatementSyntaxNode` becomes `Stmt`
- `StructSyntaxNode` becomes `StructDecl`
- `ProgramSyntaxNode` becomes `ModuleDecl`
- `ExpressionType` becomes `Type`
- Existing fields names `Type` become `type`
- There might be some collateral damage here if there were, e.g., `enum`s named `Type`, but I can live with that for now and fix those up as a I see them
Diffstat (limited to 'source/slang/lexer.cpp')
| -rw-r--r-- | source/slang/lexer.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/slang/lexer.cpp b/source/slang/lexer.cpp index 49856c1c9..84b34c9a9 100644 --- a/source/slang/lexer.cpp +++ b/source/slang/lexer.cpp @@ -18,7 +18,7 @@ namespace Slang Token* TokenList::end() const { SLANG_ASSERT(mTokens.Count()); - SLANG_ASSERT(mTokens[mTokens.Count()-1].Type == TokenType::EndOfFile); + SLANG_ASSERT(mTokens[mTokens.Count()-1].type == TokenType::EndOfFile); return &mTokens[mTokens.Count() - 1]; } @@ -40,7 +40,7 @@ namespace Slang Token token = *mCursor; if (mCursor == mEnd) - token.Type = TokenType::EndOfFile; + token.type = TokenType::EndOfFile; return token; } @@ -49,7 +49,7 @@ namespace Slang if (mCursor == mEnd) return TokenType::EndOfFile; SLANG_ASSERT(mCursor); - return mCursor->Type; + return mCursor->type; } CodePosition TokenReader::PeekLoc() const @@ -67,7 +67,7 @@ namespace Slang Token token = *mCursor; if (mCursor == mEnd) - token.Type = TokenType::EndOfFile; + token.type = TokenType::EndOfFile; else mCursor++; return token; @@ -774,8 +774,8 @@ namespace Slang String getStringLiteralTokenValue(Token const& token) { - SLANG_ASSERT(token.Type == TokenType::StringLiteral - || token.Type == TokenType::CharLiteral); + SLANG_ASSERT(token.type == TokenType::StringLiteral + || token.type == TokenType::CharLiteral); char const* cursor = token.Content.begin(); char const* end = token.Content.end(); @@ -1244,7 +1244,7 @@ namespace Slang break; } - token.Type = tokenType; + token.type = tokenType; char const* textEnd = cursor; @@ -1303,7 +1303,7 @@ namespace Slang Token token = lexToken(); tokenList.mTokens.Add(token); - if(token.Type == TokenType::EndOfFile) + if(token.type == TokenType::EndOfFile) return tokenList; } } |
