forked from lix-project/lix
repl indenting
This commit is contained in:
parent
6fe660acf9
commit
b18ed02b76
|
@ -10,8 +10,6 @@ namespace nix {
|
||||||
|
|
||||||
const std::string nativeSystem = SYSTEM;
|
const std::string nativeSystem = SYSTEM;
|
||||||
|
|
||||||
// Traces show the chain of calls in nix code. If an ErrPos is included the surrounding
|
|
||||||
// lines of code will print.
|
|
||||||
BaseError & BaseError::addTrace(std::optional<ErrPos> e, hintformat hint)
|
BaseError & BaseError::addTrace(std::optional<ErrPos> e, hintformat hint)
|
||||||
{
|
{
|
||||||
err.traces.push_front(Trace { .pos = e, .hint = hint});
|
err.traces.push_front(Trace { .pos = e, .hint = hint});
|
||||||
|
|
|
@ -119,9 +119,6 @@ protected:
|
||||||
// string prefix_; // used for location traces etc.
|
// string prefix_; // used for location traces etc.
|
||||||
mutable ErrorInfo err;
|
mutable ErrorInfo err;
|
||||||
|
|
||||||
// mutable std::optional<string> trace_;
|
|
||||||
// const string& calcTrace() const;
|
|
||||||
|
|
||||||
mutable std::optional<string> what_;
|
mutable std::optional<string> what_;
|
||||||
const string& calcWhat() const;
|
const string& calcWhat() const;
|
||||||
|
|
||||||
|
@ -167,11 +164,9 @@ public:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const string & msg() const { return calcWhat(); }
|
const string & msg() const { return calcWhat(); }
|
||||||
// const string & trace() const { return calcTrace(); }
|
|
||||||
// BaseError & addPrefix(const FormatOrString & fs);
|
|
||||||
BaseError & addTrace(std::optional<ErrPos> e, hintformat hint);
|
|
||||||
|
|
||||||
const ErrorInfo & info() { calcWhat(); return err; }
|
const ErrorInfo & info() { calcWhat(); return err; }
|
||||||
|
|
||||||
|
BaseError & addTrace(std::optional<ErrPos> e, hintformat hint);
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MakeError(newClass, superClass) \
|
#define MakeError(newClass, superClass) \
|
||||||
|
|
|
@ -163,12 +163,12 @@ static int listPossibleCallback(char *s, char ***avp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
// Used to communicate to NixRepl::getLine whether a signal occurred in ::readline.
|
// Used to communicate to NixRepl::getLine whether a signal occurred in ::readline.
|
||||||
volatile sig_atomic_t g_signal_received = 0;
|
volatile sig_atomic_t g_signal_received = 0;
|
||||||
|
|
||||||
void sigintHandler(int signo) {
|
void sigintHandler(int signo) {
|
||||||
g_signal_received = signo;
|
g_signal_received = signo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NixRepl::mainLoop(const std::vector<std::string> & files)
|
void NixRepl::mainLoop(const std::vector<std::string> & files)
|
||||||
|
|
Loading…
Reference in a new issue