Bodged in support for region pragmas

Have them as basic directives

They're similar to the assert and panic macros but are hardcoded to true

#region    (<string literal>)
#endregion (<string literal>)
This commit is contained in:
ed
2024-05-12 14:02:38 -04:00
parent e462116f94
commit 1db5fb32cd
3 changed files with 18 additions and 2 deletions
+15 -1
View File
@@ -1670,7 +1670,21 @@ gb_internal bool check_builtin_procedure_directive(CheckerContext *c, Operand *o
operand->value = found->Constant.value;
}
}
} else {
}
// Bodging in #region & #endregion support
else if (name == "region") {
operand->type = t_untyped_bool;
operand->mode = Addressing_Constant;
operand->value = exact_value_bool(true);
}
else if (name == "endregion") {
operand->type = t_untyped_bool;
operand->mode = Addressing_Constant;
operand->value = exact_value_bool(true);
}
else {
error(call, "Unknown directive call: #%.*s", LIT(name));
}
return true;