fix(hypetalk): parse start using stack aliases - #297
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
start using stack "Name"andstop using stack "Name"commands.stackkeyword.Root Cause
The parser consumed
usingand immediately parsed the next token as the expression. For Classic scripts likestart using stack "MYres1",stackwas parsed as an object-reference expression, which resolved to the current stack id. The imported MystopenStackscript then attempted to load that id as a resource stack alias and reportedStack not found: 735DC4B0-CF0F-4AFF-A449-E198020D1358instead of loadingMYres1.Changes
stackkeyword before parsing the alias expression in both start/stop using statements.start using "Alias"andstop using "Alias"behavior.HypeStackLibraryused-stack state and returned canonical aliases.Testing
swift buildscripts/test.sh --filter UsingStackKeywordDEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer swift test --no-parallel --filter InterpreterFuzzNoCrashTests --filter InterpreterMetamorphicTests(blocked locally:/Applications/Xcode-beta.app/Contents/Developermissing)swift test --no-parallel --filter InterpreterFuzzNoCrashTests --filter InterpreterMetamorphicTests