Skip to content

Lingo and VM additions for Bionicle Attic Media#85

Open
matthewdean wants to merge 17 commits intomainfrom
bionicle-atticmedia-lingo-additions
Open

Lingo and VM additions for Bionicle Attic Media#85
matthewdean wants to merge 17 commits intomainfrom
bionicle-atticmedia-lingo-additions

Conversation

@matthewdean
Copy link
Collaborator

@matthewdean matthewdean commented Mar 25, 2026

Summary

  • Add new Lingo global properties: keyPressed, cpuHogTicks (no-op), pi, getPos
  • Add stage property setters: title (fix hardcoded value), bgColor
  • Add datum operations: element-wise list division, list multiplication, chunk assignment coercion, string conversion for CastMember, count/number on void
  • Implement PushVarRef opcode with symbol-based variable resolution for global/property/instance variables
  • Use Lingo evaluator for do command, add string concat and constants to static eval
  • Handle bare go command as gotoLoop
  • Make the key return only ASCII (add keyPressed for full Unicode)
  • Fix Lingo grammar: use atomic &reserved_keyword lookahead instead of word_boundary (fixes pest implicit whitespace issue)

Notes

All changes are meant to be safe Lingo/VM additions that should not break existing movies. This is part 1 of a series splitting the bionicle-atticmedia branch into reviewable PRs.

Test plan

  • Builds with wasm-pack build --dev --target web
  • Verify existing movies still play correctly
  • Test Bionicle Attic Media movie progression

🤖 Generated with Claude Code

matthewdean and others added 17 commits March 24, 2026 23:10
Adds `the keyPressed` which returns the last key including non-ASCII
characters (D5+ behavior). Also adds `key_pressed()` to KeyboardManager.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Matches Director behavior: `the key` returns empty string for non-ASCII
key presses. Use `the keyPressed` for full Unicode support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Routes getPos() calls to the appropriate list/propList handler based
on datum type.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The setter was hardcoding "title" instead of using the provided value.
Now correctly stores the string value from the Lingo assignment.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Accepts ColorRef or integer palette index values for setting the
stage background color.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously only lists of length 2 were handled (as pseudo-points).
Now element-wise multiplication works for lists of any size,
fixing errors like [142, 166, 69] * 14.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds push_var_ref() to the stack bytecode handler and implements
symbol-based resolution for global (0x1/0x2) and property/instance
(0x3) variables in both get and set paths. Symbols pushed by
PushVarRef are resolved by name rather than numeric index.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add "member" and "put" to reserved_keyword list. Use atomic
&reserved_keyword positive lookahead on castlib_ref, member_ref,
sprite_ref, field_ref, and chunk_type rules to enforce word boundaries
correctly — pest's implicit whitespace insertion in non-atomic rules
breaks the simpler word_boundary approach. Remove now-redundant
!^"put" and !^"set" guards from handler_call and command_inline since
lang_ident already excludes reserved keywords.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@matthewdean matthewdean requested a review from igorlira March 25, 2026 06:14
@matthewdean matthewdean marked this pull request as ready for review March 25, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant