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;
|
string formedString;
|
||||||
for (;i < in.size(); ++i) {
|
for (;i < in.size(); ++i) {
|
||||||
const tok::type currentCharType = getIdentifierCharType(in[i]);
|
const tok::type currentCharType = getIdentifierCharType(in[i]);
|
||||||
const bool isString = currentCharType == STRING;
|
const bool isStringDelimiter = currentCharType == STRING;
|
||||||
if (isTypeString && (i == in.size() - 1 && not isString)) throw tok::LexerException("A never ending string was found", lineNumber);
|
if (isTypeString && (i == in.size() - 1 && not isStringDelimiter)) throw tok::LexerException("A never ending string was found", lineNumber);
|
||||||
if ((currentCharType == type || isTypeString) && !isString) {
|
if ((currentCharType == type || isTypeString) && !isStringDelimiter) {
|
||||||
formedString += in[i];
|
formedString += in[i];
|
||||||
} else {
|
} else {
|
||||||
if (not isTypeString) --i;
|
if (not isTypeString) --i;
|
||||||
|
|
|
@ -93,7 +93,7 @@ protected:
|
||||||
} catch (const out_of_range&) {
|
} catch (const out_of_range&) {
|
||||||
throw Yerbacon::Exception(string(
|
throw Yerbacon::Exception(string(
|
||||||
#ifndef __GNUC__
|
#ifndef __GNUC__
|
||||||
id.name()
|
id.name() // This is undefined behaviour but most other compilers should output the name
|
||||||
#else
|
#else
|
||||||
abi::__cxa_demangle(id.name(), nullptr, nullptr, nullptr)
|
abi::__cxa_demangle(id.name(), nullptr, nullptr, nullptr)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -58,7 +58,7 @@ int main(int argc, char* argv[]) {
|
||||||
unit_result resultingPair;
|
unit_result resultingPair;
|
||||||
try {
|
try {
|
||||||
resultingPair.first = Target::forName(target, newLines)->transpileWithTree(
|
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())
|
if (!text_provided or output_directory.has_value())
|
||||||
outputFileContent(
|
outputFileContent(
|
||||||
|
|
Loading…
Reference in New Issue