mirror of
https://github.com/cc65/cc65.git
synced 2025-08-08 06:25:17 +00:00
Replace hard returns with an "else", add an error for non-IDENT tokens, and test for static
This commit is contained in:
committed by
greg-king5
parent
60d8559372
commit
f328481a48
@@ -90,14 +90,12 @@ void GotoStatement (void)
|
|||||||
|
|
||||||
/* Find array size */
|
/* Find array size */
|
||||||
if (!IsTypeArray (arr->Type) || SizeOf (arr->Type) == 0 ||
|
if (!IsTypeArray (arr->Type) || SizeOf (arr->Type) == 0 ||
|
||||||
|
!(arr->Flags & SC_STATIC) ||
|
||||||
SizeOf (GetElementType(arr->Type)) != 2) {
|
SizeOf (GetElementType(arr->Type)) != 2) {
|
||||||
Error ("Expected array");
|
Error ("Expected a static array");
|
||||||
return;
|
} else if (GetElementCount (arr->Type) > 127) {
|
||||||
}
|
|
||||||
if (GetElementCount (arr->Type) > 127) {
|
|
||||||
Error ("Only arrays with <= 127 labels are supported, got %lu",
|
Error ("Only arrays with <= 127 labels are supported, got %lu",
|
||||||
GetElementCount (arr->Type));
|
GetElementCount (arr->Type));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ConsumeLBrack ();
|
ConsumeLBrack ();
|
||||||
@@ -153,6 +151,8 @@ void GotoStatement (void)
|
|||||||
cur = cur->NextSym;
|
cur = cur->NextSym;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else { /* It was not TOK_IDENT, or we couldn't find the symbol */
|
||||||
|
Error ("Array name expected");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user