New line shouldn't be the first token
This commit is contained in:
@@ -22,7 +22,11 @@ vector<shared_ptr<Token>> Lexer::getTokens() {
|
||||
if (!token->isValid()) {
|
||||
cerr << "Unexpected character '" << token->getLexme() << "' at " << token->getLine() << ":" << token->getColumn() << endl;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Don't add new line as the first token
|
||||
if (tokens.empty() && token->isOfKind({TokenKind::NEW_LINE}))
|
||||
continue;
|
||||
|
||||
// Insert an additional new line just before end
|
||||
if (token->getKind() == TokenKind::END && tokens.back()->getKind() != TokenKind::NEW_LINE)
|
||||
|
||||
@@ -74,14 +74,14 @@ int main(int argc, char **argv) {
|
||||
cout << endl << endl;
|
||||
}
|
||||
|
||||
/*ModuleBuilder moduleBuilder(moduleName, inputFilePath, statements);
|
||||
ModuleBuilder moduleBuilder(moduleName, inputFilePath, statements);
|
||||
shared_ptr<llvm::Module> module = moduleBuilder.getModule();
|
||||
if (isVerbose) {
|
||||
module->print(llvm::outs(), nullptr);
|
||||
}
|
||||
|
||||
CodeGenerator codeGenerator(module);
|
||||
codeGenerator.generateObjectFile(outputKind);*/
|
||||
codeGenerator.generateObjectFile(outputKind);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user