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

Forward referencing does not really work anymore #98

Open
zimmski opened this issue May 24, 2017 · 0 comments
Open

Forward referencing does not really work anymore #98

zimmski opened this issue May 24, 2017 · 0 comments
Labels

Comments

@zimmski
Copy link
Owner

zimmski commented May 24, 2017

$Even Sequence = start: 0,
                  step: 2

START = A

A = "The first " $B.Count " even Integers are:" B

B = +4,10($Even.Next " ")

results into the internal structure

(0xc4200e4d80)&lists.Concatenation{tokens:[]token.Token{(*sequences.SequenceResetItem)(0xc4200960e0), (*primitives.Scope)(0xc42010f040)}}
        (0xc4200960e0)&sequences.SequenceResetItem{sequence:(*sequences.Sequence)(0xc4200e4ae0)}                     
        (0xc42010f040)&primitives.Scope{token:(*lists.Concatenation)(0xc4200e4f00)}                                  
                (0xc4200e4f00)&lists.Concatenation{tokens:[]token.Token{(*primitives.ConstantString)(0xc42010f020), (*aggregates.Len)(0xc42010f060), (*primitives.ConstantString)(0xc42010f030), (*aggregates.Len)(0xc42010f070)}}
                        (0xc42010f020)&primitives.ConstantString{value:"The first "}                                 
                        (0xc42010f060)&aggregates.Len{token:(*lists.Repeat)(0xc420108380)}                           
                        (0xc42010f030)&primitives.ConstantString{value:" even Integers are:"}                        
                        (0xc42010f070)&aggregates.Len{token:(*lists.Repeat)(0xc420108380)} 

Which is wrong because the last token in the output should be "B" which is a repeater.

$Even Sequence = start: 0,
                  step: 2

START = A

A = B "The first " $B.Count " even Integers are:" B

B = +4,10($Even.Next " ")

Does not work at all

tavor --print-internal --format-file blub.tavor                                                 
cannot parse tavor file: L:6, C:23 - unknown token attribute "Count" for token type "*primitives.Pointer"

On the other hand, the following works:

$Even Sequence = start: 0,
                  step: 2

B = +4,10($Even.Next " ")
A = "The first " $B.Count " even Integers are:" B
                  
START = A

So there is clearly something wrong with the current implementation.

@zimmski zimmski added the bug label May 24, 2017
@zimmski zimmski changed the title .Count does not really work Forward referencing does not really work anymore May 24, 2017
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