mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
comments
This commit is contained in:
parent
54f91923c8
commit
555baa8fb0
2 changed files with 6 additions and 13 deletions
|
@ -11,21 +11,15 @@ int main()
|
||||||
// In each program where errors occur, this has to be set.
|
// In each program where errors occur, this has to be set.
|
||||||
ErrorInfo::programName = std::optional("error-demo");
|
ErrorInfo::programName = std::optional("error-demo");
|
||||||
|
|
||||||
// There are currently four constructor functions:
|
// Error in a program; no hint and no nix code.
|
||||||
//
|
|
||||||
// ProgramError, ProgramWarning, NixLangError, NixLangWarning.
|
|
||||||
//
|
|
||||||
|
|
||||||
// ProgramError takes name, description, and an optional hint.
|
|
||||||
printErrorInfo(
|
printErrorInfo(
|
||||||
ErrorInfo { .level = elError,
|
ErrorInfo { .level = elError,
|
||||||
.name = "name",
|
.name = "name",
|
||||||
.description = "error description",
|
.description = "error description",
|
||||||
});
|
});
|
||||||
|
|
||||||
// ProgramWarning takes name, description, and an optional hint.
|
// Warning with name, description, and hint.
|
||||||
// The hint is in the form of a hintfmt class, which wraps boost::format(),
|
// The hintfmt function makes all the substituted text yellow.
|
||||||
// and makes all the substituted text yellow.
|
|
||||||
printErrorInfo(
|
printErrorInfo(
|
||||||
ErrorInfo { .level = elWarning,
|
ErrorInfo { .level = elWarning,
|
||||||
.name = "name",
|
.name = "name",
|
||||||
|
@ -35,7 +29,7 @@ int main()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// NixLangWarning adds nix file, line number, column range, and the lines of
|
// Warning with nix file, line number, column, and the lines of
|
||||||
// code where a warning occurred.
|
// code where a warning occurred.
|
||||||
SymbolTable testTable;
|
SymbolTable testTable;
|
||||||
auto problem_file = testTable.create("myfile.nix");
|
auto problem_file = testTable.create("myfile.nix");
|
||||||
|
@ -53,8 +47,7 @@ int main()
|
||||||
.nextLineOfCode = std::nullopt
|
.nextLineOfCode = std::nullopt
|
||||||
}});
|
}});
|
||||||
|
|
||||||
// NixLangError is just the same as NixLangWarning, except for the Error
|
// Error with previous and next lines of code.
|
||||||
// flag.
|
|
||||||
printErrorInfo(
|
printErrorInfo(
|
||||||
ErrorInfo{
|
ErrorInfo{
|
||||||
.level = elError,
|
.level = elError,
|
||||||
|
|
|
@ -50,7 +50,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------
|
// ----------------------------------------------------------------
|
||||||
// format for hints. same as fmt, except templated values
|
// format function for hints. same as fmt, except templated values
|
||||||
// are always in yellow.
|
// are always in yellow.
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
|
Loading…
Reference in a new issue