target ObjectSpecifier was not compatible with context, i.e. specifying a target as first button (which will interpret to the first button in the context of the script) would throw errors. This has to do with a missing clause in the interpreter to handle such situations.
target could not be set by name, i.e. specifying a target like button "My Button" of current card would throw an error. This has to do with Ohm's greediness and the fact that variables had to come after object specifiers in factors.
As an example, this earlier failing script will now work:
on click
if the "target"
then
tell target to set "text-color" to "blue"
else
set "target" to first button
end if
end click
I've added various tests.
I've also fixed up an annoying thing where the grammar would open up as many times as you got a grammar error (or more?!). Now it will only open if not already there.
Also i included a few fun examples in the this PR from earlier work.
Main Points
This PR fixes two target related bugs:
first button
(which will interpret to the first button in the context of the script) would throw errors. This has to do with a missing clause in the interpreter to handle such situations.button "My Button" of current card
would throw an error. This has to do with Ohm's greediness and the fact that variables had to come after object specifiers in factors.As an example, this earlier failing script will now work:
I've added various tests.
I've also fixed up an annoying thing where the grammar would open up as many times as you got a grammar error (or more?!). Now it will only open if not already there.
Also i included a few fun examples in the this PR from earlier work.