Target.hpp: Return false by default in the uniqueLineSeparator function

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2022-05-07 09:07:32 +02:00
parent 6e35682911
commit de658bd032
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 2 additions and 2 deletions

View File

@ -119,7 +119,7 @@ protected:
}
typedef optional<const char*> optional_string;
virtual optional_string uniqueLineSeparator() { return ";"; };
virtual bool use_uniqueLineSeparator() { return supportsOneLine(); };
virtual bool use_uniqueLineSeparator() { return false; };
const bool newLines;
string separator;
static constexpr const char* indentation = " ";
@ -142,7 +142,7 @@ public:
};
static unique_ptr<Target> forName(string_view name, bool newLines);
string transpileWithTree(const ParseTree& tree) {
separator = newLines ? "\n" : (use_uniqueLineSeparator() ? uniqueLineSeparator().value() : throw Yerbacon::Exception("--newlines=off is not supported by the current target"));
separator = newLines ? "\n" : (supportsOneLine() ? uniqueLineSeparator().value() : throw Yerbacon::Exception("--newlines=off is not supported by the current target"));
output.str(string());
separate_transpileTree(tree);
return output.str() + '\n';