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

Scopes for token attributes are just wrong #42

Open
zimmski opened this issue Nov 6, 2014 · 1 comment
Open

Scopes for token attributes are just wrong #42

zimmski opened this issue Nov 6, 2014 · 1 comment
Labels

Comments

@zimmski
Copy link
Owner

zimmski commented Nov 6, 2014

The following format

Number = +,10([0-9])

Inner = "\t i1.before: " $Number.Count "\n",
        "\t i1: " Number "\n",
        "\t i1.after: " $Number.Count "\n",
        "\t i2.before: " $Number.Count "\n",
        "\t i2: " Number "\n",
        "\t i2.after: " $Number.Count "\n"

START = "z1.before: " $Number.Count "\n",
        "z1: " Number "\n",
        "o1.before: " $Number.Count "\n",
        "o1: " Inner "\n",
        "o1.after: " $Number.Count "\n",
        "o2: " Inner "\n",
        "o2.after: " $Number.Count "\n",
        "z2.before: " $Number.Count "\n",
        "z2: " Number "\n",
        "z2.after: " $Number.Count "\n"

Prints

z1.before: 2
z1: 0271
o1.before: 4
o1:      i1.before: 8
         i1: 35652257
         i1.after: 8
         i2.before: 8
         i2: 52
         i2.after: 2

o1.after: 4
o2:      i1.before: 8
         i1: 65404
         i1.after: 8
         i2.before: 8
         i2: 266909
         i2.after: 2

o2.after: 4
z2.before: 4
z2: 060
z2.after: 3

So the second inner scope uses the list from the first inner scope? This is just wrong -> there would be no scoping. And of course none of the second scope's list are used in the Counts. This is even more wrong.

It should be as followed:

A.1 Count // prints the Count of the A list since this is the first List in the scope
A New List // all following Counts will use this List until a new one is defined
A.2 Count
{ // new scope
  A.3 Count // since the outer scope is copied into the inner one, A is the first List
  B New List // all following Counts will use this list until a new one is defined
  B.4 Count
  C New List // here is a new one
  C.5 Count
} // end of inner scope -> outer scope is in place again
A.6 Count
D New List
D.7 Count
@zimmski
Copy link
Owner Author

zimmski commented Nov 30, 2014

This is NO "variable" problem, we simply do not have token attributes yet. This also means that scopes have to be updated when tokens clone children -> how? what is the best way for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant