Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpretations of variables with unusual names is ambiguous #144

Open
chrysaora-achlyos opened this issue Aug 22, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@chrysaora-achlyos
Copy link

Describe the bug

Shortcuts allows for unusual variable names, say for instance the number "1", or what mistakenly be understood as expressions like "-varA" or "-(varA)". leading to some odd looking, and ambiguous code



import Shortcuts
#Color: red, #Icon: shortcuts
var 1="a"
quicklook(input: 1)
var varB=1
quicklook(input: varB)

line 4 compiles to valid shortcut and displays "a"
Not sure on line 5 if varB should be assign the value of the variable named "1" (hence "a") or the number 1
line 5 compiles to valid shortcut and currently displays "1"

To Reproduce

Steps to reproduce the behavior:

  1. put the above code in Jellycuts
  2. Compile and load as a shortcut
  3. run shortcut
  4. See the first quicklook displays "a"
  5. See the second quicklook displays 1

Expected behavior

Shrug. not sure if second quicklook should display "a" or 1. The ambiguity is the issue.

Screenshots

If applicable, add screenshots to help explain your problem.

Information

  • Device: iPhone SE
  • OS: iOS 17.6.1
  • Jellycuts Version v2.3(0)
  • Jailbroken? No

Additional context

import Shortcuts #Color: red, #Icon: shortcuts var varA="a" quicklook(input: 1) var varB=-varA quicklook(input: varB) var varC=-(varA) compiles with out error, but does not run since a variable named "-varA" does not exist, and variable named "-(varA)" does not exist.
import Shortcuts #Color: red, #Icon: shortcuts var -(varA)="a" quicklook(input: -(varA)) strange as it may look, compiles and runs

potentially Jellycuts should restrict variable names to starting with only certain characters, even if it means being unable to express some code that does compile and run in shortcuts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant