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

Sequence behavior changes capture index when global variable is set before #87

Closed
phorward opened this issue Nov 28, 2022 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@phorward
Copy link
Member

Works:

a = 2 "a" "b" print($(a + 1))

Works not:

a = 1; a = 2 "a" "b" print($(a + 1))

First occurred during testcase merging in #86, but reproducible all time, also without input consuming.

@phorward phorward added the bug Something isn't working label Nov 28, 2022
@phorward phorward self-assigned this Nov 28, 2022
@phorward phorward changed the title Strange sequence behavior when global variable is involved Sequence behavior changes capture index when global variable is set before Nov 28, 2022
@phorward
Copy link
Member Author

phorward commented Nov 28, 2022

This produces the expected result:

a = 1; a = 2 "a" "b" print($(a))

Same result with

a = 2 "a" "b" print($3)  # works
a = 1; a = 2 "a" "b" print($2)  # works (but $2 should refer to "a")

phorward added a commit that referenced this issue Nov 29, 2022
- Fixes bug report #87
- Improved VM step debugging
phorward added a commit to phorward/tokay that referenced this issue Nov 29, 2022
phorward added a commit that referenced this issue Nov 30, 2022
* Removing output/error from Runtime and Compiler

Intention is to solve #83 differently.

* Improving test::testcase() function

- Allows for direct code exposal
- Improved error reporting in assert_eq!()

* tests()-test runs all testcases in folder "tests/"

* testcase() using repl-mode

* test_expressions.tok with testmode:repl usage

* Some docs and testcase testcase ;-)

* Improving testcase

- Count and report line numbers
- Trim result lines

* Starting separated, topic-based tests

* Starting test substitution by test cases

* Fixing assignment operatins in brackets

* Substituting tests for assig-ops by testcase

* Tests for inline increment/decrement

* Renaming testcases and removing testcase calls

* Separating sequence tests, glob filter tests

* Adding prelude tests

* Improving testcase(), replacing whitespace test

* Moving unescaping tests into testcase

* Moving error test into testcase

* Substituting further tests from test.rs

* Replacing dict-tests by tests/dict.tok testcase

* Converting token_modifiers test into testcase

* Substitute language test-cases from test.rs

This is a nice milestone on the test conversion; Now only the builtin-tests are available in their particular modules.

* Moving list tests into list.tok testcase

* Moving str tests into str.tok testcase

* Rewrote token tests and fixed bug

Bug with pluralized character-classes, e.g. AsciiAlphabetics wasn't found, but Alphabetics due incomplete type distinguishing.

* Rewrote parselet testcases / ParseletRef::repr()

* Moving all remaining tests to separate testcases

* First version of tokay_tests!() macro

Macro generates [test]-functions from testcases in tests/*.tok which are evaluating during a `cargo test` run similar to the tests before.

Removed the `tests()` function with similar use-case but not running in parallel as well.

* Moving testcase to utils

* Removed bug #87 bypass in test `captures.tok`
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