Source code printing in error messages #27

Closed
opened 2022-05-30 00:32:31 +02:00 by robben · 3 comments
robben commented 2022-05-30 00:32:31 +02:00 (Migrated from engi.evolpe.it)

Examples of multiline error printing

GCC

src/errors.cc:114:51: error: conversion from ‘void’ to non-scalar type ‘std::string_view’ {aka ‘std::basic_string_view<char>’} requested
  114 |         std::string_view short_description = visit(Overloaded {
      |                                              ~~~~~^~~~~~~~~~~~~
  115 |                 [](errors::Failed_Numeric_Parsing const&)               { return "Failed to parse a number"; },
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  116 |                 [](errors::Not_Callable const&)                         { return "Value not callable"; },
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  117 |                 [](errors::Undefined_Operator const&)                   { return "Undefined operator"; },
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  118 |                 [](errors::Unexpected_Empty_Source const&)              { return "Unexpected end of file"; },
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  119 |                 [](errors::Unexpected_Keyword const&)                   { return "Unexpected keyword"; },
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  120 |                 [](errors::Unrecognized_Character const&)               { return "Unrecognized character"; },
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  121 |                 [](errors::internal::Unexpected_Token const&)           { return "Unexpected token"; },
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  122 |                 [](errors::Expected_Expression_Separator_Before const&) { return "Missing semicolon"; }
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  123 |         }, err.details);

Elm

Detected problems in 1 module.
-- UNFINISHED LIST ------------------------------------------------ src/Main.elm

I cannot find the end of this list:

12| update msg model = [
13|   case msg of
14|     Increment ->
15|       model + 1
16| 
17|     Decrement ->
18|       model - 1
                   ^
You can just add a closing ] right here, and I will be all set!
# Examples of multiline error printing ## GCC ``` src/errors.cc:114:51: error: conversion from ‘void’ to non-scalar type ‘std::string_view’ {aka ‘std::basic_string_view<char>’} requested 114 | std::string_view short_description = visit(Overloaded { | ~~~~~^~~~~~~~~~~~~ 115 | [](errors::Failed_Numeric_Parsing const&) { return "Failed to parse a number"; }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 116 | [](errors::Not_Callable const&) { return "Value not callable"; }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 117 | [](errors::Undefined_Operator const&) { return "Undefined operator"; }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 118 | [](errors::Unexpected_Empty_Source const&) { return "Unexpected end of file"; }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 119 | [](errors::Unexpected_Keyword const&) { return "Unexpected keyword"; }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 120 | [](errors::Unrecognized_Character const&) { return "Unrecognized character"; }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 121 | [](errors::internal::Unexpected_Token const&) { return "Unexpected token"; }, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 122 | [](errors::Expected_Expression_Separator_Before const&) { return "Missing semicolon"; } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 123 | }, err.details); ``` ## Elm ``` Detected problems in 1 module. -- UNFINISHED LIST ------------------------------------------------ src/Main.elm I cannot find the end of this list: 12| update msg model = [ 13| case msg of 14| Increment -> 15| model + 1 16| 17| Decrement -> 18| model - 1 ^ You can just add a closing ] right here, and I will be all set! ```
robben commented 2022-05-30 00:32:31 +02:00 (Migrated from engi.evolpe.it)

assigned to @robben

assigned to @robben
robben commented 2022-05-30 00:32:54 +02:00 (Migrated from engi.evolpe.it)

changed the description

changed the description
robben commented 2022-06-09 01:48:35 +02:00 (Migrated from engi.evolpe.it)

Basics implemented in b7d879bf70

Basics implemented in b7d879bf7055550d45779ee6459d947aa6daaa6f
Sign in to join this conversation.
No Label
bug
enhancement
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: s416496/musique#27
No description provided.