From 098a5442caeb2e9505864e985900d4793014dffc Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Thu, 6 Jul 2017 12:30:19 -0700 Subject: More exhaustive lowering - Handle all statement cases explicitly (rather than falling back to the "structural recursion" mess) - Handle back-references from child statements to their parents --- source/slang/emit.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/slang/emit.cpp') diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp index 0b79cb52f..79a8277bf 100644 --- a/source/slang/emit.cpp +++ b/source/slang/emit.cpp @@ -1491,12 +1491,15 @@ static void EmitType(EmitContext* context, RefPtr type) static void EmitType(EmitContext* context, TypeExp const& typeExp, Token const& nameToken) { EmitType(context, typeExp.type, - typeExp.exp ? typeExp.exp->Position : CodePosition(), nameToken.Content, nameToken.Position); + typeExp.exp ? typeExp.exp->Position : CodePosition(), + nameToken.Content, nameToken.Position); } static void EmitType(EmitContext* context, TypeExp const& typeExp, String const& name) { - EmitType(context, typeExp.type, typeExp.exp->Position, name, CodePosition()); + EmitType(context, typeExp.type, + typeExp.exp ? typeExp.exp->Position : CodePosition(), + name, CodePosition()); } // Statements -- cgit v1.2.3