diff options
author | Ben Burdette <bburdette@gmail.com> | 2020-04-08 09:07:58 -0600 |
---|---|---|
committer | Ben Burdette <bburdette@gmail.com> | 2020-04-08 09:07:58 -0600 |
commit | 47ed067d45d3de7786cdb55f187b0db2eb6289c1 (patch) | |
tree | a393abd58baa49e91bd343b10a1bc774de27f24c /src/error-demo | |
parent | 00c507cc52ceb0d879c43e88e70de0028ff47fc6 (diff) |
initializer style
Diffstat (limited to 'src/error-demo')
-rw-r--r-- | src/error-demo/error-demo.cc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/error-demo/error-demo.cc b/src/error-demo/error-demo.cc index ef8b56308..7eef0b162 100644 --- a/src/error-demo/error-demo.cc +++ b/src/error-demo/error-demo.cc @@ -18,22 +18,26 @@ int main() // ProgramError takes name, description, and an optional hint. printErrorInfo( - ErrorInfo::ProgramError("name", - "error description", - std::nullopt)); + ErrorInfo { .level = elError, + .name = "name", + .description = "error description", + }); // ProgramWarning takes name, description, and an optional hint. // The hint is in the form of a hintfmt class, which wraps boost::format(), // and makes all the substituted text yellow. printErrorInfo( - ErrorInfo::ProgramWarning("name", - "warning description", - std::optional( - hintfmt("there was a %1%", "warning")))); + ErrorInfo { .level = elWarning, + .name = "name", + .description = "error description", + .hint = std::optional( + hintfmt("there was a %1%", "warning")) + }); + // NixLangWarning adds nix file, line number, column range, and the lines of // code where a warning occurred. - SymbolTable testTable; +/* SymbolTable testTable; auto problem_symbol = testTable.create("problem"); printErrorInfo( @@ -58,5 +62,5 @@ int main() std::optional("next line of code"), hintfmt("this hint has %1% templated %2%!!", "yellow", "values"))); - return 0; +*/ return 0; } |