summaryrefslogtreecommitdiff
path: root/source/slang/parser.cpp
diff options
context:
space:
mode:
authorTim Foley <tim.foley.is@gmail.com>2017-07-19 18:52:38 -0700
committerGitHub <noreply@github.com>2017-07-19 18:52:38 -0700
commitf07c01ceb012b9b325a8ecebd12cdd5797d8d5b3 (patch)
tree0b93a109d51e6565560ad785519a863386490e2a /source/slang/parser.cpp
parenta2b8b4c20632d79721052abd232fe2d1bdf2700d (diff)
parent3f48e1c0d84bf4909954154ad147559656e87516 (diff)
Merge pull request #128 from tfoleyNV/improve-failure-modes
Try to improve handling of failures during compilation
Diffstat (limited to 'source/slang/parser.cpp')
-rw-r--r--source/slang/parser.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/slang/parser.cpp b/source/slang/parser.cpp
index a624c58c5..801628e30 100644
--- a/source/slang/parser.cpp
+++ b/source/slang/parser.cpp
@@ -848,8 +848,9 @@ namespace Slang
}
else
{
+ SLANG_DIAGNOSE_UNEXPECTED(parser->sink, parser->tokenReader.PeekLoc(), "needed a modifier");
+
parser->ReadToken(TokenType::Identifier);
- assert(!"unexpected");
}
}
}
@@ -1377,7 +1378,7 @@ namespace Slang
void addDecl(
RefPtr<Decl> newDecl)
{
- assert(newDecl);
+ SLANG_ASSERT(newDecl);
if( decl )
{
@@ -1715,7 +1716,7 @@ namespace Slang
RefPtr<Modifier> result;
RefPtr<Modifier>* link = &result;
- assert(!*link);
+ SLANG_ASSERT(!*link);
for (;;)
{
@@ -2440,7 +2441,7 @@ namespace Slang
ParseDeclBody(this, program, TokenType::EndOfFile);
PopScope();
- assert(currentScope == outerScope);
+ SLANG_RELEASE_ASSERT(currentScope == outerScope);
currentScope = nullptr;
}