lexer.cpp: Rename isString to isStringDelimiter

Add a few comments in other files

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2023-08-12 13:02:36 +02:00
parent a8d1e6b09a
commit 3476d3c642
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
3 changed files with 5 additions and 5 deletions

View File

@ -64,9 +64,9 @@ vector<tok> 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;

View File

@ -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

View File

@ -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(