diff options
| author | Tim Foley <tfoley@nvidia.com> | 2017-07-07 14:30:26 -0700 |
|---|---|---|
| committer | Tim Foley <tfoley@nvidia.com> | 2017-07-08 18:18:36 -0700 |
| commit | f69bc6cdb10aab2d1b202668cb7ecbcc0ddf33f2 (patch) | |
| tree | 21d5e647382c60a164c0b1c8c570dbcf5b1ac3f4 /source/slang/lower.cpp | |
| parent | f3fe9dddb8c528b4f9955d9105908600b4a8d0c8 (diff) | |
Fully parse function bodies, even in "rewriter" mode
This is in anticipation of needing to have more complete knowledge to be able to handle user code that `import`s library functionality.
The big picture of this change is just to remove the `UnparsedStmt` class that was used to hold the bodies of user functions as opaque token streams, and thus to let the full parser and compiler loose on that code. That is the easy part, of course, and the hard part is all the fixes that this requires in the rest of the compielr to make this even remotely work.
Subsequent commit address a lot of other issues, so this particular commit mostly represents work-in-progress.
One detail is that this change puts a conditional around nearly every diagnostic message in `check.cpp` to suppress thing when in rewriter mode.
I have yet to check how that works out if there are errors in anything we actually need to understand for the purposes of generating reflection data.
Diffstat (limited to 'source/slang/lower.cpp')
| -rw-r--r-- | source/slang/lower.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/source/slang/lower.cpp b/source/slang/lower.cpp index b90573495..c154c96c8 100644 --- a/source/slang/lower.cpp +++ b/source/slang/lower.cpp @@ -451,6 +451,7 @@ struct LoweringVisitor lowerExprCommon(loweredExpr, expr); loweredExpr->BaseExpression = loweredBase; loweredExpr->declRef = loweredDeclRef; + loweredExpr->name = expr->name; return loweredExpr; } @@ -687,16 +688,6 @@ struct LoweringVisitor addStmt(loweredStmt); } - void visitUnparsedStmt(UnparsedStmt* stmt) - { - RefPtr<UnparsedStmt> loweredStmt = new UnparsedStmt(); - lowerStmtFields(loweredStmt, stmt); - - loweredStmt->tokens = stmt->tokens; - - addStmt(loweredStmt); - } - void visitCaseStmt(CaseStmt* stmt) { RefPtr<CaseStmt> loweredStmt = new CaseStmt(); |
