From 7d3bfe403362b294cc2a1f2607d51dfcd447aafd Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Mon, 26 Jun 2017 09:32:40 -0700 Subject: Replace "auto-import" with `#import` Right now `#import` only differs from `#include` in that it takes a string literal for a file name instead of a raw identifier (to which `.slang` gets appended). The next step is to make `#import` respect preprocessor state, while `__import` doesn't. --- source/slang/parser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/slang/parser.cpp') diff --git a/source/slang/parser.cpp b/source/slang/parser.cpp index 0598e67a7..61d7b225d 100644 --- a/source/slang/parser.cpp +++ b/source/slang/parser.cpp @@ -805,10 +805,10 @@ namespace Slang return decl; } - static RefPtr parseAutoImportDecl( + static RefPtr parsePoundImportDecl( Parser* parser) { - Token importToken = parser->ReadToken(TokenType::AutoImport); + Token importToken = parser->ReadToken(TokenType::PoundImport); auto decl = new ImportDecl(); decl->nameToken = importToken; @@ -2186,8 +2186,8 @@ namespace Slang decl = parseModifierDecl(parser); else if(parser->LookAheadToken("__import")) decl = parseImportDecl(parser); - else if(parser->LookAheadToken(TokenType::AutoImport)) - decl = parseAutoImportDecl(parser); + else if(parser->LookAheadToken(TokenType::PoundImport)) + decl = parsePoundImportDecl(parser); else if (AdvanceIf(parser, TokenType::Semicolon)) { decl = new EmptyDecl(); -- cgit v1.2.3