Skip to content

fix(hypetalk): parse start using stack aliases - #297

Merged
jrepp merged 1 commit into
mainfrom
codex/start-using-stack-keyword
Jun 21, 2026
Merged

fix(hypetalk): parse start using stack aliases#297
jrepp merged 1 commit into
mainfrom
codex/start-using-stack-keyword

Conversation

@jrepp

@jrepp jrepp commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix HyperTalk parsing for Classic start using stack "Name" and stop using stack "Name" commands.
  • Add focused interpreter regressions for quoted stack aliases with the optional stack keyword.

Root Cause

The parser consumed using and immediately parsed the next token as the expression. For Classic scripts like start using stack "MYres1", stack was parsed as an object-reference expression, which resolved to the current stack id. The imported Myst openStack script then attempted to load that id as a resource stack alias and reported Stack not found: 735DC4B0-CF0F-4AFF-A449-E198020D1358 instead of loading MYres1.

Changes

  • Consume an optional stack keyword before parsing the alias expression in both start/stop using statements.
  • Preserve existing start using "Alias" and stop using "Alias" behavior.
  • Regress both commands against HypeStackLibrary used-stack state and returned canonical aliases.

Testing

  • swift build
  • scripts/test.sh --filter UsingStackKeyword
  • DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer swift test --no-parallel --filter InterpreterFuzzNoCrashTests --filter InterpreterMetamorphicTests (blocked locally: /Applications/Xcode-beta.app/Contents/Developer missing)
  • swift test --no-parallel --filter InterpreterFuzzNoCrashTests --filter InterpreterMetamorphicTests

Classic HyperTalk permits resource stack commands such as start using stack "MYres1" and stop using stack "MYres1". Hype previously consumed using and parsed the stack keyword as the expression, so the runtime resolved stack to the current stack object/id and attempted to load that id as an imported stack alias. On the Myst stack this surfaced as: Stack not found: 735DC4B0-CF0F-4AFF-A449-E198020D1358.\n\nConsume the optional stack keyword before parsing the alias expression for both start using and stop using. This preserves existing start using "Alias" behavior while matching the Classic form emitted by imported HyperCard stacks.\n\nRegression coverage adds focused interpreter tests for quoted stack aliases in both start and stop commands, asserting completion, returned canonical alias, and stack library used-alias state.\n\nTested:\n- swift build\n- scripts/test.sh --filter UsingStackKeyword\n- DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer swift test --no-parallel --filter InterpreterFuzzNoCrashTests --filter InterpreterMetamorphicTests (blocked: Xcode-beta path missing locally)\n- swift test --no-parallel --filter InterpreterFuzzNoCrashTests --filter InterpreterMetamorphicTests
@jrepp
jrepp marked this pull request as ready for review June 21, 2026 06:07
@jrepp
jrepp merged commit 1f85788 into main Jun 21, 2026
1 check failed
@jrepp
jrepp deleted the codex/start-using-stack-keyword branch June 21, 2026 06:08
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