@@ -32,13 +32,15 @@ namespace Fortran::parser {
32
32
// Use "..."_err_en_US, "..."_warn_en_US, "..."_port_en_US, and "..."_en_US
33
33
// string literals to define the static text and fatality of a message.
34
34
//
35
- // Error: fatal error that prevents code and module file generation
36
- // Warning: likely problem,
37
- // Portability: nonstandard or obsolete features
38
- // Because: for AttachTo(), explanatory attachment in support of another message
39
- // Context (internal): attachment from SetContext()
40
- // None: everything else, common for attachments with source locations
41
- enum class Severity { Error, Warning, Portability, Because, Context, None };
35
+ enum class Severity {
36
+ Error, // fatal error that prevents code and module file generation
37
+ Warning, // likely problem
38
+ Portability, // nonstandard or obsolete features
39
+ Because, // for AttachTo(), explanatory attachment to support another message
40
+ Context, // (internal): attachment from SetContext()
41
+ Todo, // a feature that's not yet implemented, a fatal error
42
+ None // everything else, common for attachments with source locations
43
+ };
42
44
43
45
class MessageFixedText {
44
46
public:
@@ -57,7 +59,9 @@ class MessageFixedText {
57
59
severity_ = severity;
58
60
return *this ;
59
61
}
60
- bool isFatal () const { return severity_ == Severity::Error; }
62
+ bool isFatal () const {
63
+ return severity_ == Severity::Error || severity_ == Severity::Todo;
64
+ }
61
65
62
66
private:
63
67
CharBlock text_;
@@ -77,6 +81,10 @@ constexpr MessageFixedText operator""_port_en_US(
77
81
const char str[], std::size_t n) {
78
82
return MessageFixedText{str, n, Severity::Portability};
79
83
}
84
+ constexpr MessageFixedText operator " " _todo_en_US(
85
+ const char str[], std::size_t n) {
86
+ return MessageFixedText{str, n, Severity::Todo};
87
+ }
80
88
constexpr MessageFixedText operator " " _en_US(const char str[], std::size_t n) {
81
89
return MessageFixedText{str, n, Severity::None};
82
90
}
@@ -99,7 +107,9 @@ class MessageFormattedText {
99
107
MessageFormattedText &operator =(const MessageFormattedText &) = default ;
100
108
MessageFormattedText &operator =(MessageFormattedText &&) = default ;
101
109
const std::string &string () const { return string_; }
102
- bool isFatal () const { return severity_ == Severity::Error; }
110
+ bool isFatal () const {
111
+ return severity_ == Severity::Error || severity_ == Severity::Todo;
112
+ }
103
113
Severity severity () const { return severity_; }
104
114
MessageFormattedText &set_severity (Severity severity) {
105
115
severity_ = severity;
0 commit comments