Resolved #25, Indexing an array with a non-integer causes an error

This commit is contained in:
2023-01-15 15:09:01 +00:00
parent 402abb647c
commit 51740e2b9e
8 changed files with 88 additions and 22 deletions

View File

@@ -206,6 +206,7 @@ Literal copyLiteral(Literal original) {
case LITERAL_FUNCTION_INTERMEDIATE: //caries a compiler
case LITERAL_FUNCTION_NATIVE:
case LITERAL_INDEX_BLANK:
//no copying possible
return original;
@@ -333,6 +334,9 @@ bool literalsAreEqual(Literal lhs, Literal rhs) {
fprintf(stderr, ERROR "[internal] Can't compare intermediate functions\n" RESET);
return false;
case LITERAL_INDEX_BLANK:
return false;
default:
//should never be seen
fprintf(stderr, ERROR "[internal] Unrecognized literal type in equality: %d\n" RESET, lhs.type);