From b6bc0837ba6e7fb42280bf6289f4dab633c88392 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 29 Jan 2018 16:32:52 -0800 Subject: Remove #import directive (#389) Fixes #380 The `#import` directive was a stopgap measure to allow a macro-heavy shader library to incrementally adopt `import`, but it has turned out to cause as many problems as it fixes (not least because users have never been able to form a good mental model around which kind of import to do when). This change yanks support for the feature. --- source/slang/parser.cpp | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'source/slang/parser.cpp') diff --git a/source/slang/parser.cpp b/source/slang/parser.cpp index 531606f8d..538e5d576 100644 --- a/source/slang/parser.cpp +++ b/source/slang/parser.cpp @@ -835,24 +835,6 @@ namespace Slang return decl; } - static RefPtr parsePoundImportDecl( - Parser* parser) - { - parser->haveSeenAnyImportDecls = true; - - Token importToken = parser->ReadToken(TokenType::PoundImport); - - NameLoc nameAndLoc; - nameAndLoc.name = getName(parser, importToken.Content); - nameAndLoc.loc = importToken.loc; - - auto decl = new ImportDecl(); - decl->moduleNameAndLoc = nameAndLoc; - decl->scope = parser->currentScope; - - return decl; - } - static NameLoc ParseDeclName( Parser* parser) { @@ -2592,13 +2574,6 @@ namespace Slang } break; - // The preprocessor will generate a custom token to represent - // the site of a `#import` directive, so that we can catch - // it downstream in the parser, here. - case TokenType::PoundImport: - decl = parsePoundImportDecl(parser); - break; - // If nothing else matched, we try to parse an "ordinary" declarator-based declaration default: decl = ParseDeclaratorDecl(parser, containerDecl); -- cgit v1.2.3