C++: Match more tags

This commit is contained in:
Calum Grant
2024-11-04 13:06:53 +00:00
parent 9a81ce8bb4
commit 067ecdeea0

View File

@@ -4,7 +4,16 @@ import cpp
* A syntax error.
*/
class SyntaxError extends CompilerError {
SyntaxError() { this.getTag().matches("exp_%") }
SyntaxError() {
this.getTag().matches("exp_%") or
this.getTag() =
[
"bad_data_member_initialization", "bad_pure_specifier", "bad_return", "bad_uuid_string",
"literal_without_initializer", "missing_class_definition", "missing_exception_declaration",
"nonstd_const_member_decl_not_allowed", "operator_name_not_allowed",
"wide_string_invalid_in_asm"
]
}
}
/**
@@ -12,7 +21,7 @@ class SyntaxError extends CompilerError {
* Typically this is due to a missing include.
*/
class CannotOpenFile extends CompilerError {
CannotOpenFile() { this.hasTag("cannot_open_file") }
CannotOpenFile() { this.hasTag(["cannot_open_file", "cannot_open_file_reason"]) }
string getIncludedFile() {
result = this.getMessage().regexpCapture("cannot open source file '([^']+)'", 1)