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

Onymous Loops are required #49

Open
coolaj86 opened this issue Dec 12, 2023 · 0 comments
Open

Onymous Loops are required #49

coolaj86 opened this issue Dec 12, 2023 · 0 comments
Labels
syntax the strict subset of JavaScript that is AJScript

Comments

@coolaj86
Copy link
Collaborator

coolaj86 commented Dec 12, 2023

For simplicity we'll probably require that all loops be Onymous to start, but in the future we could make it so that only broken loops are required to be Onymous.

Naming could be automated by using the name of the variable in the loop (iFor, jFor, fooFor). Minifiers could remove it when not used, of course.

Bad Example

for (let y of yyyy) {
   for (let x of xxxx) {
      if (y[x]) {
         break; // SYNTAX ERROR!!
      }
   }
}

Good Example

yloop: for (let y of yyyy) {
   xloop: for (let x of xxxx) {
      if (y[x]) {
         break xloop;
      }
   }
}
@coolaj86 coolaj86 added the syntax the strict subset of JavaScript that is AJScript label Dec 12, 2023
@coolaj86 coolaj86 changed the title Nonymous Loops Onymous Loops Dec 12, 2023
@coolaj86 coolaj86 changed the title Onymous Loops Onymous Loops are required Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
syntax the strict subset of JavaScript that is AJScript
Projects
None yet
Development

No branches or pull requests

1 participant