From 695c2700de54a5fec72ce7214c137a1dc3a02d7b Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Wed, 9 Aug 2017 10:13:40 -0700 Subject: 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 --- source/slang/lexer.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/slang/lexer.cpp') 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; } } -- cgit v1.2.3