(FEA) Featured for Location_Literalisation, Status_Literalisation etc.

This commit is contained in:
William
2024-06-06 02:22:54 +08:00
parent df073877cc
commit 54042cf2cf
28 changed files with 744 additions and 358 deletions

View File

@@ -8,17 +8,20 @@ typedef struct {
Var *members;
} Array;
static Status ArrayIndexOutOfBound = {
.description = "Given index was accessing illegal address.",
.characteristic = STATUS_ERROR,
.prev = &MemoryViolation
};
# define ArrayIndexOutOfBound = (Status){\
.identity = nameof(ArrayIndexOutOfBound),\
.value = 1,\
.description = "Given index was accessing illegal address.",\
.characteristic = STATUS_ERROR,\
.prev = &MemoryViolation\
}
static Status InvalidArrayLength = {
.description = "Given length is invalid.",
.characteristic = STATUS_ERROR,
.prev = &ErrorStatus
};
# define InvalidArrayLength (Status){\
.value = 1,\
.description = "Given length is invalid.",\
.characteristic = STATUS_ERROR,\
.prev = &ErrorStatus\
}
/* Elementary. */
Status Array_Create(Array *inst, int len, size_t size)