| English | Português (Brasil) |
Semantic-analysis diagnostics use the E3000-E3999 range.
nes.runnes.run statement.Trigger:
begin
nes.set_background_color($21);
end.
Expected compiler output:
E3001 demo.nsp:4:1
The program must start the runtime with nes.run.
nes.run; after initialization and
before any nes.wait_frame statement.nes.runnes.run, but additional nes.run calls may not.Trigger:
nes.run;
nes.run;
Expected compiler output:
E3002 demo.nsp:2:1
nes.run may appear only once.
nes.run call.nes.set_background_color before nes.run. Later queued calls are allowed.Trigger:
begin
nes.run;
end.
Expected compiler output:
E3003 demo.nsp:3:1
The program must set its initial background color exactly once.
nes.set_background_color(value); call before
nes.run.Trigger:
var
Color: byte;
COLOR: byte;
Expected compiler output:
E3004 demo.nsp:3:5
Symbol COLOR is already declared.
Trigger:
Counter := Missing;
Expected compiler output:
E3005 demo.nsp:1:12
Unknown identifier: Missing.
Trigger:
Maximum := $10;
Expected compiler output:
E3006 demo.nsp:1:1
Cannot assign to constant Maximum.
Trigger:
Missing := $01;
Expected compiler output:
E3007 demo.nsp:1:1
Unknown variable: Missing.
var section.Trigger:
var
BackgroundColor: nes_color;
begin
nes.set_background_color(BackgroundColor);
Expected compiler output:
E3008 demo.nsp:4:30
Variable BackgroundColor is read before it is assigned.
nes.set_background_color(BackgroundColor);
^^^^^^^^^^^^^^^
nes.run must execute exactly once in the top-level program
block and cannot be placed on a conditional execution path. Palette calls
are allowed and queue changes after runtime starts.Trigger:
if Enabled then
nes.run;
Expected compiler output:
E3009 demo.nsp:2:5
nes.run cannot appear inside a conditional branch.
break and continue require an enclosing while,
repeat, or for loop that provides their control-flow target.Trigger:
begin
break;
end.
Expected compiler output:
E3010 demo.nsp:2:5
break can appear only inside a loop.
nes.run must execute exactly once and cannot be repeated
by a loop. Palette calls are allowed and queue changes after runtime starts.Trigger:
while Running do
nes.run;
Expected compiler output:
E3011 demo.nsp:2:5
nes.run cannot appear inside a loop body.
for loop owns its control variable while its body is
executing. Assigning it, updating it with inc or dec, or reusing it as
the control variable of a nested for would make loop termination
unpredictable.Trigger:
for Index := $00 to $03 do
Index := $01;
Expected compiler output:
E3012 demo.nsp:2:5
For control variable Index cannot be modified inside its loop body.
Trigger:
begin
Missing;
end.
Expected compiler output:
E3013 demo.nsp:2:5
Unknown procedure: Missing.
Trigger:
procedure Again;
begin
Again;
end;
Expected compiler output:
E3014 demo.nsp:4:5
Recursive procedure call involving Again is not supported.
nes.run belongs to the main initialization sequence and
nes.wait_frame depends on the main block’s known runtime phase. Palette
calls are allowed in procedures and functions and publish changes for
VBlank. The restriction applies equally to both callable kinds.Trigger:
procedure WaitInsideProcedure;
begin
nes.wait_frame;
end;
Expected compiler output:
E3015 demo.nsp:4:5
nes.wait_frame cannot appear inside a procedure.
Trigger:
procedure Initialize(Value: byte);
begin
end;
begin
Initialize;
end.
Expected compiler output:
E3016 demo.nsp:7:5
Procedure Initialize expects 1 argument(s), but 0 were provided.
nes.wait_frame observes a counter changed by NMI. Before
nes.run, NMI is disabled and the wait could never complete.Trigger: Compile
tests/fixtures/diagnostics/frame_wait_before_run.nsp, or write:
nes.set_background_color($21);
nes.wait_frame;
nes.run;
Expected compiler output:
E3017 frame_wait_before_run.nsp:4:5
nes.wait_frame cannot execute before nes.run starts NMI.
nes.wait_frame and its containing frame loop after
the unconditional top-level nes.run call.nes.on_update(Missing);Expected compiler output:
E3018 demo.nsp:4:19
Unknown callback procedure: Missing.
procedure Update(Value: byte); with
nes.on_update(Update);.E3019 followed by Callback procedure Update
must not have parameters.nes.on_update(...) statements in initialization.E3020 followed by Only one update callback
may be registered.nes.on_vblank(...) statements in initialization.E3021 followed by Only one VBlank callback
may be registered.nes.run.nes.on_update(Update); in an if, loop, procedure, or
after nes.run.E3022 followed by a callback registration
context explanation.nes.run.while, repeat, for, arithmetic, a comparison,
nes.wait_frame, or another unsupported statement on the VBlank call path.E3023 identifies the unsafe operation and
the procedure path that reaches it.inc/dec, safe conditionals, palette staging calls
with temporary-free values, and validated helpers.E3024 identifies the invalid call edge.Both with both nes.on_update(Both); and
nes.on_vblank(Both);.E3025 followed by Procedure Both cannot be
registered as both update and VBlank callbacks.nes.controller_down($03, nes.button_a) or index $00.E3026 identifies the invalid constant.$01, $02, or a declared byte constant with one
of those values.E3027 followed by requires a compile-time
controller index.$01, $02, or a direct declared byte constant.nes.button_* constant, not a literal, user constant, expression, or unknown
button name.nes.controller_down($01, nes.button_fire).E3028 identifies the invalid button.E3029 reports the provided count.nes.controller_pressed($01, nes.button_start).nes.set_sprite_zero with other than four arguments.E3030 reports the provided count.byte expressions. This helper is not a
general sprite API.byte
value from $00 through $03.$04 or a dynamic expression to
nes.set_background_palette or its individual-color form.E3031 identifies the invalid index and API.$00..$03 or a byte constant in that range.byte value
from $00 through $03.$04 or a dynamic expression to nes.set_sprite_palette
or its individual-color form.E3032 identifies the invalid index and API.$00..$03 or a byte constant in that range.$00..$03 at
compile time.$04 or a dynamic expression.E3033 identifies the invalid color index.$00..$03 or a byte constant in that range.E3034 reports the expected and actual count.nes.load_background() selects the background configured
by compiler options and therefore takes no source-language arguments.nes.load_background($00);E3035 reports the provided argument count.nes.load_background(); without arguments.nes.run enables rendering.nes.load_background(); after nes.run;.E3036 identifies the unsafe command.nes.run;.nes.load_background(); twice in the main block.E3037 points to the second call.nes.set_tile requires tile X, tile Y, and tile index.tests/fixtures/diagnostics/set_tile_argument_count.nsp, or omit or add an
argument to nes.set_tile.E3038 reports the expected and actual count.nes.set_tile(x, y, tile) with three byte values.nes.get_tile requires tile X and tile Y.tests/fixtures/diagnostics/get_tile_argument_count.nsp, or omit or add an
argument to nes.get_tile.E3039 reports the expected and actual count.nes.get_tile(x, y) with two byte values.nes.set_attribute requires attribute X, attribute Y, and
one raw attribute byte.tests/fixtures/diagnostics/set_attribute_argument_count.nsp.E3040 reports the expected and actual count.nes.set_attribute(x, y, value) with three byte
values.nes.clear_background_updates() takes no arguments.tests/fixtures/diagnostics/clear_background_updates_argument_count.nsp.E3041 reports the provided count.nes.clear_background_updates(); without arguments.tests/fixtures/diagnostics/invalid_tile_coordinate.nsp, use X above 31, or
use Y above 29 in nes.set_tile or nes.get_tile.E3042 identifies the coordinate and valid
range.tests/fixtures/diagnostics/invalid_attribute_coordinate.nsp, use X above 7,
or use Y above 7 in nes.set_attribute.E3043 identifies the coordinate and valid
range.nes.background_updates_overflowed() reads one fixed
runtime flag and takes no arguments.tests/fixtures/diagnostics/background_updates_overflowed_argument_count.nsp.E3044 reports the provided count.nes.background_updates_overflowed() without
arguments and use its boolean result.nes.clear_background_update_overflow() clears one fixed
runtime flag and takes no arguments.tests/fixtures/diagnostics/clear_background_update_overflow_argument_count.nsp.E3045 reports the provided count.nes.clear_background_update_overflow(); without
arguments.
nes.set_scroll requires exactly two arguments: horizontal
scroll and vertical scroll.nes.set_scroll with fewer or more than two arguments.E3046 followed by the expected and actual
argument counts.byte values, for example
nes.set_scroll($08, $04);.sprite index and one
property value. nes.sprite_hide and nes.sprite_show require only the
sprite index.tests/fixtures/diagnostics/sprite_argument_count.nsp, or omit or add an
argument to a nes.sprite_* statement.E3047 reports the command’s expected and
actual argument counts.nes.sprite_set_palette must be in
$00..$03.tests/fixtures/diagnostics/invalid_sprite_palette.nsp, or pass $04 or
greater as a compile-time palette value.E3048 identifies the value and valid range.$00, $01, $02, or $03.nes.sprite_create() is a parameterless compile-time OAM
reservation expression.tests/fixtures/diagnostics/sprite_create_argument_count.nsp or pass any
argument to nes.sprite_create.E3049 reports that zero arguments were
expected and identifies the provided count.nes.sprite_create() with empty parentheses.nes.sprite_create() sites, and statically owned metasprite components share
the NES’s fixed 64-entry OAM capacity. Static allocation cannot reserve
another non-conflicting entry or component group.tests/fixtures/diagnostics/sprite_capacity_exhausted.nsp or otherwise
reserve all 64 indexes before another creation site.E3050 identifies the creation site that
cannot receive an OAM entry.nes.run, must name one asset configured with
--metasprite, and every configured asset must be imported.tests/fixtures/diagnostics/invalid_metasprite_import.nsp
without configuring its player metadata, nest the import, or move it after
runtime startup.E3051 identifies the invalid import or the
configured asset that lacks an import statement.nes.import_metasprite(player); directly in the main block before
nes.run;.tests/fixtures/diagnostics/duplicate_metasprite_import.nsp with the player
asset configured.E3052 identifies the second import.nes.metasprite_create requires exactly one imported,
symbolic frame such as player.idle_0. The creation site has a persistent
static identity and is not a heap allocation.tests/fixtures/diagnostics/invalid_metasprite_create.nsp or call the
intrinsic without one symbolic frame.E3053 explains the invalid creation form.tests/fixtures/diagnostics/metasprite_argument_count.nsp.E3054 reports the expected and actual counts.tests/fixtures/diagnostics/incompatible_metasprite_frame.nsp with both
referenced assets configured.E3055 names the instance and frame assets.nes.metasprite_set_animation requires one imported,
symbolic animation belonging to the instance’s creation asset. Animation
names are compiler-only symbols and cannot be replaced with numeric values.tests/fixtures/diagnostics/invalid_metasprite_animation.nsp, or pass a
statically known animation from another asset.E3056 identifies the non-symbolic or
incompatible animation selection.player.movement_right from the
same imported asset used by nes.metasprite_create.tests/fixtures/diagnostics/invalid_builtin_context.nsp, or write
nes.sprite_create(); as a standalone statement.E3057 names the builtin and its registered
context.E3058 covers ordinary signatures that did not previously
have a dedicated diagnostic.tests/fixtures/diagnostics/invalid_builtin_argument_count.nsp.E3058 reports the expected and provided
argument counts.tests/fixtures/diagnostics/unknown_function.nsp.tests/fixtures/diagnostics/function_argument_count.nsp.() for a parameterless call.tests/fixtures/diagnostics/function_used_as_statement.nsp.tests/fixtures/diagnostics/procedure_used_as_expression.nsp.tests/fixtures/diagnostics/undefined_function_result.nsp.nes.random_range have
a minimum greater than the maximum.tests/fixtures/diagnostics/invalid_random_range.nsp.E3064 identifies the reversed constant range.