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:
parent
a8d1e6b09a
commit
3476d3c642
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue