summaryrefslogtreecommitdiff
path: root/source/slang/slang-lexer.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2020-01-24 17:14:04 -0500
committerGitHub <noreply@github.com>2020-01-24 17:14:04 -0500
commitd98a2b75c9b4a31de0ebfb1084a68b5be5ede17d (patch)
treefa59a35b7473e20808f00a2bfb78bc4074f01d05 /source/slang/slang-lexer.cpp
parentb8f294445b998eadb9b09e2b91eb462b881eaf2e (diff)
Fix for infinite recursion with macro invocation (#1177)
* First pass fix of macro expansion logic to stop recursive application (causting a recursive loop), whilst also allowing application on parameters to a macro. * Added recursive-macro test. Fixed macro application example.
Diffstat (limited to 'source/slang/slang-lexer.cpp')
-rw-r--r--source/slang/slang-lexer.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/slang/slang-lexer.cpp b/source/slang/slang-lexer.cpp
index d7c086fba..67ad53764 100644
--- a/source/slang/slang-lexer.cpp
+++ b/source/slang/slang-lexer.cpp
@@ -19,15 +19,15 @@ namespace Slang
Token* TokenList::begin() const
{
- SLANG_ASSERT(mTokens.getCount());
- return &mTokens[0];
+ SLANG_ASSERT(m_tokens.getCount());
+ return &m_tokens[0];
}
Token* TokenList::end() const
{
- SLANG_ASSERT(mTokens.getCount());
- SLANG_ASSERT(mTokens[mTokens.getCount()-1].type == TokenType::EndOfFile);
- return &mTokens[mTokens.getCount() - 1];
+ SLANG_ASSERT(m_tokens.getCount());
+ SLANG_ASSERT(m_tokens[m_tokens.getCount() - 1].type == TokenType::EndOfFile);
+ return &m_tokens[m_tokens.getCount() - 1];
}
TokenSpan::TokenSpan()
@@ -1325,7 +1325,7 @@ namespace Slang
for(;;)
{
Token token = lexToken();
- tokenList.mTokens.add(token);
+ tokenList.add(token);
if(token.type == TokenType::EndOfFile)
return tokenList;