From 2055d540c5dd420448a6924d784d5aed0efcd93d Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 11 Sep 2017 09:33:46 -0700 Subject: Support IR-based codegen for a few more examples. The main interesting change here is around support for lowering of calls to "subscript" operations (what a C++ programmer would think of as `operator[]`). An important infrastructure change here was to add an explicit AST-node representation for a "static member expression" which we use whenever a member is looked up in a type as opposed to a value. The implementation of this probably isn't robust yet, but it turns out to be important to be able to tell such cases apart. --- source/slang/parser.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/slang/parser.cpp') diff --git a/source/slang/parser.cpp b/source/slang/parser.cpp index 8ea41641d..2381682aa 100644 --- a/source/slang/parser.cpp +++ b/source/slang/parser.cpp @@ -2121,6 +2121,8 @@ namespace Slang static RefPtr parseAccessorDecl(Parser* parser) { + Modifiers modifiers = ParseModifiers(parser); + RefPtr decl; if( AdvanceIf(parser, "get") ) { @@ -2136,6 +2138,8 @@ namespace Slang return nullptr; } + AddModifiers(decl, modifiers.first); + if( parser->tokenReader.PeekTokenType() == TokenType::LBrace ) { decl->Body = parser->ParseBlockStatement(); -- cgit v1.2.3