@@ -31,28 +31,29 @@ namespace langutil
31
31
32
32
struct LineColumn
33
33
{
34
- int line;
35
- int column;
34
+ int line = {- 1 } ;
35
+ int column = {- 1 } ;
36
36
37
+ LineColumn () = default ;
37
38
LineColumn (std::tuple<int , int > const & _t): line{std::get<0 >(_t)}, column{std::get<1 >(_t)} {}
38
- LineColumn (int _line, int _column): line{_line}, column{_column} {}
39
- LineColumn (): line{-1 }, column{-1 } {}
40
39
};
41
40
42
41
struct SourceReference
43
42
{
44
- std::string message; // /< A message that relates to this source reference (such as a warning or an error message).
45
- std::string sourceName; // /< Underlying source name (for example the filename).
46
- LineColumn position; // /< Actual (error) position this source reference is surrounding.
47
- bool multiline; // /< Indicates whether the actual SourceReference is truncated to one line.
48
- std::string text; // /< Extracted source code text (potentially truncated if multiline or too long).
49
- int startColumn; // /< Highlighting range-start of text field.
50
- int endColumn; // /< Highlighting range-end of text field.
43
+ std::string message; // /< A message that relates to this source reference (such as a warning or an error message).
44
+ std::string sourceName; // /< Underlying source name (for example the filename).
45
+ LineColumn position; // /< Actual (error) position this source reference is surrounding.
46
+ bool multiline = { false }; // /< Indicates whether the actual SourceReference is truncated to one line.
47
+ std::string text; // /< Extracted source code text (potentially truncated if multiline or too long).
48
+ int startColumn = {- 1 }; // /< Highlighting range-start of text field.
49
+ int endColumn = {- 1 }; // /< Highlighting range-end of text field.
51
50
52
51
// / Constructs a SourceReference containing a message only.
53
52
static SourceReference MessageOnly (std::string _msg)
54
53
{
55
- return SourceReference{std::move (_msg), " " , LineColumn{-1 , -1 }, false , " " , -1 , -1 };
54
+ SourceReference sref;
55
+ sref.message = std::move (_msg);
56
+ return sref;
56
57
}
57
58
};
58
59
0 commit comments