diff --git a/src/etc/lexer.cpp b/src/etc/lexer.cpp index b11187d..325ef98 100644 --- a/src/etc/lexer.cpp +++ b/src/etc/lexer.cpp @@ -64,9 +64,9 @@ vector lex(const string_view& in) string formedString; for (;i < in.size(); ++i) { const tok::type currentCharType = getIdentifierCharType(in[i]); - const bool isString = currentCharType == STRING; - if (isTypeString && (i == in.size() - 1 && not isString)) throw tok::LexerException("A never ending string was found", lineNumber); - if ((currentCharType == type || isTypeString) && !isString) { + const bool isStringDelimiter = currentCharType == STRING; + if (isTypeString && (i == in.size() - 1 && not isStringDelimiter)) throw tok::LexerException("A never ending string was found", lineNumber); + if ((currentCharType == type || isTypeString) && !isStringDelimiter) { formedString += in[i]; } else { if (not isTypeString) --i; diff --git a/src/headers/transpiler/Target.hpp b/src/headers/transpiler/Target.hpp index 324d909..2060c7f 100644 --- a/src/headers/transpiler/Target.hpp +++ b/src/headers/transpiler/Target.hpp @@ -93,7 +93,7 @@ protected: } catch (const out_of_range&) { throw Yerbacon::Exception(string( #ifndef __GNUC__ - id.name() + id.name() // This is undefined behaviour but most other compilers should output the name #else abi::__cxa_demangle(id.name(), nullptr, nullptr, nullptr) #endif diff --git a/src/main.cpp b/src/main.cpp index 75f388a..9315327 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -58,7 +58,7 @@ int main(int argc, char* argv[]) { unit_result resultingPair; try { resultingPair.first = Target::forName(target, newLines)->transpileWithTree( - parseString(text_provided ? string(currentArgument) + '\n' : getFileContent(file_path->string())) + parseString(text_provided ? string(currentArgument) + '\n' : getFileContent(file_path->string(/* NOTE: This string is expected to finish with a line ending */))) ); if (!text_provided or output_directory.has_value()) outputFileContent(