Skip to content

Commit

Permalink
fix: Fixed import not being parsed correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
alinalihassan committed Mar 12, 2022
1 parent 5d3f973 commit d515f7b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Backend/Codegen.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "AST/ExprVisitor.h"
#include "AST/StmtVisitor.h"
#include "Frontend/Parser.h"
#include "LesmaJIT.h"
#include "JIT/LesmaJIT.h"
#include "Symbol/SymbolTable.h"
#include <clang/Driver/Driver.h>
#include <filesystem>
Expand Down
2 changes: 2 additions & 0 deletions src/Frontend/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,11 @@ Statement *Parser::ParseImport() {

if (AdvanceIfMatchAny<TokenType::AS>()) {
auto alias = Consume(TokenType::IDENTIFIER);
ConsumeNewline();
return new Import({loc.Start, alias.getEnd()}, token->lexeme, alias->lexeme);
}

ConsumeNewline();
return new Import({loc.Start, token.getEnd()}, filepath, getBasename(token->lexeme));
}

Expand Down
File renamed without changes.

0 comments on commit d515f7b

Please sign in to comment.