ya-tagscript 1.6.2__tar.gz → 1.6.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/.github/workflows/black.yml +1 -1
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/.pre-commit-config.yaml +1 -1
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/CHANGELOG.md +10 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/PKG-INFO +3 -3
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/README.md +2 -2
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/conf.py +1 -1
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/pyproject.toml +1 -1
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interpreter/interpreter.py +37 -6
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interpreter/parse_state.py +30 -21
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interpreter/ts_parser.py +83 -80
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/.github/dependabot.yml +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/.github/workflows/publish.yml +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/.github/workflows/test.yml +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/.gitignore +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/.python-version +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/.readthedocs.yaml +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/LICENSE.md +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/Makefile +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/_ext/glossary_backlink_checker.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/_ext/styled_list_directive.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/adapters.rst +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/blocks.rst +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/changelog.rst +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/code_examples/adapters/int_adapter_example.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/code_examples/adapters/member_adapter_example.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/code_examples/nested_blocks_example.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/code_examples/quickstart_example.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/credits.rst +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/exceptions.rst +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/glossary.rst +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/index.rst +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/interfaces.rst +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/interpreter.rst +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/intro.rst +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/make.bat +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/numeric_parser.rst +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/quickstart.rst +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/requirements.txt +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/make_release.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/discord_adapters/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/discord_adapters/attribute_adapter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/discord_adapters/channel_adapter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/discord_adapters/guild_adapter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/discord_adapters/member_adapter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/function_adapter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/int_adapter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/object_adapter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/string_adapter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/actions/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/actions/command_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/actions/delete_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/actions/override_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/actions/react_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/actions/redirect_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/actions/silence_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/conditional/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/conditional/all_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/conditional/any_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/conditional/if_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/discord/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/discord/cooldown_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/discord/embed_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/flow/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/flow/break_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/flow/shortcutredirect_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/flow/stop_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/limiters/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/limiters/blacklist_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/limiters/require_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/lists/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/lists/cycle_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/lists/list_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/math/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/math/math_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/math/ordinal_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/meta/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/meta/comment_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/meta/debug_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/rng/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/rng/fiftyfifty_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/rng/random_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/rng/range_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/strings/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/strings/case_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/strings/join_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/strings/python_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/strings/replace_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/strings/substring_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/strings/urldecode_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/strings/urlencode_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/time/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/time/strf_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/time/timedelta_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/variables/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/variables/assign_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/variables/loose_variable_getter_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/variables/strict_variable_getter_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/exceptions/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/exceptions/exceptions.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interfaces/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interfaces/adapterabc.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interfaces/blockabc.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interfaces/interpreterabc.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interfaces/nodeabc.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interpreter/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interpreter/context.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interpreter/node.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interpreter/response.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/py.typed +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/util/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/util/conditionals.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/util/escaping.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/util/splitter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/.coveragerc +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/docs/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/docs/code_examples/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/docs/code_examples/adapters/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/docs/code_examples/adapters/test_int_adapter_example.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/docs/code_examples/adapters/test_member_adapter_example.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/docs/code_examples/test_nested_blocks_example.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/docs/code_examples/test_quickstart_example.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/discord_adapters/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/discord_adapters/test_attribute_adapter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/discord_adapters/test_channel_adapter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/discord_adapters/test_guild_adapter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/discord_adapters/test_member_adapter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/test_function_adapter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/test_int_adapter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/test_object_adapter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/test_string_adapter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/actions/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/actions/test_command_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/actions/test_delete_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/actions/test_override_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/actions/test_react_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/actions/test_redirect_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/actions/test_silence_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/conditional/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/conditional/test_all_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/conditional/test_any_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/conditional/test_if_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/discord/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/discord/test_cooldown_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/discord/test_embed_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/flow/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/flow/test_break_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/flow/test_shortcutredirect_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/flow/test_stop_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/limiters/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/limiters/test_blacklist_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/limiters/test_require_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/lists/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/lists/test_cycle_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/lists/test_list_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/math/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/math/test_math_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/math/test_ordinal_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/meta/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/meta/test_comment_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/meta/test_debug_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/rng/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/rng/test_fiftyfifty_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/rng/test_random_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/rng/test_range_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/strings/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/strings/test_case_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/strings/test_join_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/strings/test_python_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/strings/test_replace_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/strings/test_substring_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/strings/test_urldecode_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/strings/test_urlencode_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/time/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/time/test_strf_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/time/test_timedelta_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/variables/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/variables/test_assign_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/variables/test_loose_variable_getter_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/variables/test_strict_variable_getter_block.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/interpreter/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/interpreter/test_interpreter.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/interpreter/test_node.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/interpreter/test_parse_state.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/interpreter/test_ts_parser.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/util/__init__.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/util/test_conditionals.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/util/test_escaping.py +0 -0
- {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/util/test_splitter.py +0 -0
|
@@ -15,7 +15,7 @@ jobs:
|
|
|
15
15
|
python-version-file: ".python-version"
|
|
16
16
|
|
|
17
17
|
- name: Lint with black
|
|
18
|
-
uses: psf/black@
|
|
18
|
+
uses: psf/black@87928e6d6761a4a6d22250e1fee5601b3998086e # 26.5.1
|
|
19
19
|
with:
|
|
20
20
|
options: '--check --diff --verbose'
|
|
21
21
|
src: '.'
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
*Currently none*
|
|
4
4
|
|
|
5
|
+
# v1.6.4
|
|
6
|
+
|
|
7
|
+
- Parser state optimizations
|
|
8
|
+
- Parsing and interpretation performance improvements
|
|
9
|
+
|
|
10
|
+
# v1.6.3
|
|
11
|
+
|
|
12
|
+
- Performance improvements in the parser
|
|
13
|
+
- Performance improvements in the interpreter
|
|
14
|
+
|
|
5
15
|
# v1.6.2
|
|
6
16
|
|
|
7
17
|
- Fix import structure
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ya_tagscript
|
|
3
|
-
Version: 1.6.
|
|
3
|
+
Version: 1.6.4
|
|
4
4
|
Summary: Yet Another TagScript fork. An easy drop in user-provided Templating system.
|
|
5
5
|
Project-URL: Changelog, https://ya-tagscript.readthedocs.io/en/latest/changelog.html
|
|
6
6
|
Project-URL: Documentation, https://ya-tagscript.readthedocs.io
|
|
@@ -25,7 +25,7 @@ Description-Content-Type: text/markdown
|
|
|
25
25
|
|
|
26
26
|
# ya_tagscript - Yet Another TagScript fork
|
|
27
27
|
|
|
28
|
-
Current stable version: v1.6.
|
|
28
|
+
Current stable version: v1.6.4
|
|
29
29
|
|
|
30
30
|
## Information
|
|
31
31
|
|
|
@@ -87,7 +87,7 @@ or
|
|
|
87
87
|
<!--VERSIONED TAG SECTION START-->
|
|
88
88
|
|
|
89
89
|
```
|
|
90
|
-
pip install git+https://github.com/MajorTanya/ya_tagscript.git@v1.6.
|
|
90
|
+
pip install git+https://github.com/MajorTanya/ya_tagscript.git@v1.6.4
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
<!--VERSIONED TAG SECTION END-->
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ya_tagscript - Yet Another TagScript fork
|
|
2
2
|
|
|
3
|
-
Current stable version: v1.6.
|
|
3
|
+
Current stable version: v1.6.4
|
|
4
4
|
|
|
5
5
|
## Information
|
|
6
6
|
|
|
@@ -62,7 +62,7 @@ or
|
|
|
62
62
|
<!--VERSIONED TAG SECTION START-->
|
|
63
63
|
|
|
64
64
|
```
|
|
65
|
-
pip install git+https://github.com/MajorTanya/ya_tagscript.git@v1.6.
|
|
65
|
+
pip install git+https://github.com/MajorTanya/ya_tagscript.git@v1.6.4
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
<!--VERSIONED TAG SECTION END-->
|
|
@@ -26,7 +26,14 @@ _logger = logging.getLogger(__name__)
|
|
|
26
26
|
|
|
27
27
|
class TagScriptInterpreter(InterpreterABC):
|
|
28
28
|
|
|
29
|
-
__slots__ = (
|
|
29
|
+
__slots__ = (
|
|
30
|
+
"blocks",
|
|
31
|
+
"_parser",
|
|
32
|
+
"work_limit",
|
|
33
|
+
"total_work",
|
|
34
|
+
"_named_blocks",
|
|
35
|
+
"_unnamed_blocks",
|
|
36
|
+
)
|
|
30
37
|
|
|
31
38
|
def __init__(
|
|
32
39
|
self,
|
|
@@ -36,6 +43,20 @@ class TagScriptInterpreter(InterpreterABC):
|
|
|
36
43
|
self.blocks: Sequence[BlockABC] = blocks
|
|
37
44
|
self.work_limit: int | None = None
|
|
38
45
|
self.total_work: int = 0
|
|
46
|
+
# fast lookup dict for blocks with non-None _accepted_names
|
|
47
|
+
self._named_blocks: dict[str, BlockABC] = {}
|
|
48
|
+
# fallback list for blocks where _accepted_names is None
|
|
49
|
+
self._unnamed_blocks: list[BlockABC] = []
|
|
50
|
+
|
|
51
|
+
# register blocks in the appropriate group
|
|
52
|
+
for block in blocks:
|
|
53
|
+
# noinspection PyProtectedMember
|
|
54
|
+
names = block._accepted_names # pyright: ignore [reportPrivateUsage]
|
|
55
|
+
if names is not None:
|
|
56
|
+
for name in names:
|
|
57
|
+
self._named_blocks[name.lower()] = block
|
|
58
|
+
else:
|
|
59
|
+
self._unnamed_blocks.append(block)
|
|
39
60
|
|
|
40
61
|
def process(
|
|
41
62
|
self,
|
|
@@ -84,15 +105,15 @@ class TagScriptInterpreter(InterpreterABC):
|
|
|
84
105
|
# in other words, this is plaintext to us
|
|
85
106
|
return subject
|
|
86
107
|
ast = self._parser.parse(subject)
|
|
87
|
-
output:
|
|
108
|
+
output: str = ""
|
|
88
109
|
node_processing_fn = self._process_node
|
|
89
110
|
for node in ast:
|
|
90
111
|
try:
|
|
91
112
|
node_output = node_processing_fn(node, response, original)
|
|
92
|
-
output
|
|
113
|
+
output += node_output
|
|
93
114
|
except StopError as e:
|
|
94
115
|
_logger.debug("StopError raised on %r", node, exc_info=e)
|
|
95
|
-
output =
|
|
116
|
+
output = e.message
|
|
96
117
|
break
|
|
97
118
|
|
|
98
119
|
if node.type != NodeType.TEXT:
|
|
@@ -103,10 +124,20 @@ class TagScriptInterpreter(InterpreterABC):
|
|
|
103
124
|
node_output,
|
|
104
125
|
)
|
|
105
126
|
|
|
106
|
-
return
|
|
127
|
+
return output
|
|
107
128
|
|
|
108
129
|
def _process_context(self, ctx: Context) -> str | None:
|
|
109
|
-
|
|
130
|
+
declaration = ctx.node.declaration
|
|
131
|
+
if declaration is not None:
|
|
132
|
+
named_block = self._named_blocks.get(declaration.lower())
|
|
133
|
+
if named_block is not None and named_block.will_accept(ctx):
|
|
134
|
+
processed = named_block.process(ctx)
|
|
135
|
+
if processed is not None:
|
|
136
|
+
result = str(processed)
|
|
137
|
+
ctx.node.output = result
|
|
138
|
+
return result
|
|
139
|
+
|
|
140
|
+
for b in self._unnamed_blocks:
|
|
110
141
|
if b.will_accept(ctx):
|
|
111
142
|
processed = b.process(ctx)
|
|
112
143
|
if processed is not None:
|
|
@@ -20,19 +20,6 @@ class ParseState(Enum):
|
|
|
20
20
|
IN_PAYLOAD = auto() # After the colon
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
VALID_TRANSITIONS: dict[int, frozenset[ParseState]] = {
|
|
24
|
-
ParseState.EXPECTING_DECLARATION.value: frozenset({ParseState.IN_DECLARATION}),
|
|
25
|
-
ParseState.IN_DECLARATION.value: frozenset(
|
|
26
|
-
{ParseState.IN_PARAMETER, ParseState.IN_PAYLOAD},
|
|
27
|
-
),
|
|
28
|
-
ParseState.IN_PARAMETER.value: frozenset({ParseState.POST_PARAMETER}),
|
|
29
|
-
ParseState.POST_PARAMETER.value: frozenset(
|
|
30
|
-
{ParseState.IN_PAYLOAD},
|
|
31
|
-
), # Or pop (not a state)
|
|
32
|
-
ParseState.IN_PAYLOAD.value: frozenset(), # Only pop gets out of payload
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
23
|
@dataclass(slots=True)
|
|
37
24
|
class BlockParseState:
|
|
38
25
|
"""
|
|
@@ -43,10 +30,10 @@ class BlockParseState:
|
|
|
43
30
|
state: ParseState
|
|
44
31
|
block_depth: int = 0
|
|
45
32
|
paren_depth: int = 0
|
|
46
|
-
declaration:
|
|
47
|
-
parameter:
|
|
33
|
+
declaration: str | None = None
|
|
34
|
+
parameter: str | None = None
|
|
48
35
|
has_parameter_section: bool = False # True if 1-depth () exist, even if empty
|
|
49
|
-
payload:
|
|
36
|
+
payload: str | None = None
|
|
50
37
|
has_payload_section: bool = False # True if 1-depth : exists, even if empty
|
|
51
38
|
|
|
52
39
|
def finalize(self) -> NodeABC:
|
|
@@ -54,16 +41,16 @@ class BlockParseState:
|
|
|
54
41
|
if self.declaration is None:
|
|
55
42
|
raise ValueError("Cannot finalize BLOCK Node without a declaration.")
|
|
56
43
|
|
|
57
|
-
parameter =
|
|
44
|
+
parameter = self.parameter if self.parameter is not None else None
|
|
58
45
|
if self.has_parameter_section and parameter is None:
|
|
59
46
|
parameter = ""
|
|
60
47
|
|
|
61
|
-
payload =
|
|
48
|
+
payload = self.payload if self.payload is not None else None
|
|
62
49
|
if self.has_payload_section and payload is None:
|
|
63
50
|
payload = ""
|
|
64
51
|
|
|
65
52
|
node = Node.block(
|
|
66
|
-
declaration=
|
|
53
|
+
declaration=self.declaration,
|
|
67
54
|
parameter=parameter,
|
|
68
55
|
payload=payload,
|
|
69
56
|
)
|
|
@@ -92,6 +79,28 @@ class BlockParseState:
|
|
|
92
79
|
- EXPECTING_DECLARATION can transition to the base None state if the tokens
|
|
93
80
|
are "{}"
|
|
94
81
|
"""
|
|
95
|
-
if
|
|
82
|
+
if (
|
|
83
|
+
self.state == ParseState.EXPECTING_DECLARATION
|
|
84
|
+
and next_state == ParseState.IN_DECLARATION
|
|
85
|
+
):
|
|
86
|
+
self.state = next_state
|
|
87
|
+
|
|
88
|
+
elif self.state == ParseState.IN_DECLARATION and (
|
|
89
|
+
next_state == ParseState.IN_PARAMETER or next_state == ParseState.IN_PAYLOAD
|
|
90
|
+
):
|
|
91
|
+
self.state = next_state
|
|
92
|
+
|
|
93
|
+
elif (
|
|
94
|
+
self.state == ParseState.IN_PARAMETER
|
|
95
|
+
and next_state == ParseState.POST_PARAMETER
|
|
96
|
+
):
|
|
97
|
+
self.state = next_state
|
|
98
|
+
|
|
99
|
+
elif (
|
|
100
|
+
self.state == ParseState.POST_PARAMETER
|
|
101
|
+
and next_state == ParseState.IN_PAYLOAD
|
|
102
|
+
):
|
|
103
|
+
self.state = next_state
|
|
104
|
+
|
|
105
|
+
else:
|
|
96
106
|
raise ValueError(f"Invalid state transition: {self.state} -> {next_state}")
|
|
97
|
-
self.state = next_state
|
|
@@ -38,13 +38,13 @@ class TagScriptParser:
|
|
|
38
38
|
def __init__(self) -> None:
|
|
39
39
|
self._nodes: list[NodeABC] = []
|
|
40
40
|
self._state: BlockParseState | None = None
|
|
41
|
-
self._text_buffer:
|
|
41
|
+
self._text_buffer: str = ""
|
|
42
42
|
|
|
43
43
|
def parse(self, input_str: str) -> list[NodeABC]:
|
|
44
44
|
"""Converts a string into a list of Nodes and handling nested blocks as text"""
|
|
45
45
|
self._nodes = []
|
|
46
46
|
self._state = None
|
|
47
|
-
self._text_buffer =
|
|
47
|
+
self._text_buffer = ""
|
|
48
48
|
i = 0
|
|
49
49
|
input_len = len(input_str)
|
|
50
50
|
special_chars = _SPECIAL_TOKENS
|
|
@@ -53,8 +53,9 @@ class TagScriptParser:
|
|
|
53
53
|
# this is an extremely hot loop so there are additional local references to
|
|
54
54
|
# instance attributes in order to squeeze a bit more performance from the
|
|
55
55
|
# parser
|
|
56
|
+
char = ""
|
|
56
57
|
while i < input_len:
|
|
57
|
-
previous_char =
|
|
58
|
+
previous_char = char
|
|
58
59
|
char = input_str[i]
|
|
59
60
|
block: BlockParseState | None = self._state
|
|
60
61
|
current_state = block.state if block is not None else None
|
|
@@ -65,7 +66,7 @@ class TagScriptParser:
|
|
|
65
66
|
while i < input_len and input_str[i] not in special_chars:
|
|
66
67
|
i += 1
|
|
67
68
|
text = input_str[start:i]
|
|
68
|
-
self._text_buffer
|
|
69
|
+
self._text_buffer += text
|
|
69
70
|
continue
|
|
70
71
|
|
|
71
72
|
try:
|
|
@@ -74,7 +75,7 @@ class TagScriptParser:
|
|
|
74
75
|
if block is None or current_state is None:
|
|
75
76
|
if previous_char == BACKSLASH:
|
|
76
77
|
# escaped, don't start block
|
|
77
|
-
self._text_buffer
|
|
78
|
+
self._text_buffer += char
|
|
78
79
|
i += 1
|
|
79
80
|
continue
|
|
80
81
|
self._flush_text_buffer()
|
|
@@ -90,52 +91,52 @@ class TagScriptParser:
|
|
|
90
91
|
|
|
91
92
|
if current_state == ParseState.EXPECTING_DECLARATION:
|
|
92
93
|
block.transition_state(ParseState.IN_DECLARATION)
|
|
93
|
-
block.declaration =
|
|
94
|
+
block.declaration = char
|
|
94
95
|
elif current_state == ParseState.IN_DECLARATION:
|
|
95
96
|
if block.declaration is None:
|
|
96
|
-
block.declaration =
|
|
97
|
+
block.declaration = char
|
|
97
98
|
else:
|
|
98
|
-
block.declaration
|
|
99
|
+
block.declaration += char
|
|
99
100
|
elif current_state == ParseState.IN_PARAMETER:
|
|
100
101
|
if block.parameter is None:
|
|
101
|
-
block.parameter =
|
|
102
|
+
block.parameter = char
|
|
102
103
|
else:
|
|
103
|
-
block.parameter
|
|
104
|
+
block.parameter += char
|
|
104
105
|
elif current_state == ParseState.IN_PAYLOAD:
|
|
105
106
|
if block.payload is None:
|
|
106
|
-
block.payload =
|
|
107
|
+
block.payload = char
|
|
107
108
|
else:
|
|
108
|
-
block.payload
|
|
109
|
+
block.payload += char
|
|
109
110
|
elif current_state == ParseState.POST_PARAMETER:
|
|
110
111
|
# only colon or pop is allowed here, abort the block entirely
|
|
111
|
-
self._text_buffer
|
|
112
|
-
self._text_buffer
|
|
112
|
+
self._text_buffer += _reconstruct_partial_block(block)
|
|
113
|
+
self._text_buffer += char
|
|
113
114
|
self._state = None
|
|
114
115
|
# endregion Opening brace handling
|
|
115
116
|
|
|
116
117
|
elif char == BRACE_CLOSE:
|
|
117
118
|
# region Closing brace handling
|
|
118
119
|
if block is None or current_state is None:
|
|
119
|
-
self._text_buffer
|
|
120
|
+
self._text_buffer += char
|
|
120
121
|
i += 1
|
|
121
122
|
continue
|
|
122
123
|
elif block.block_depth == 1:
|
|
123
124
|
if previous_char == BACKSLASH:
|
|
124
125
|
if current_state == ParseState.IN_DECLARATION:
|
|
125
126
|
if block.declaration is None:
|
|
126
|
-
block.declaration =
|
|
127
|
+
block.declaration = char
|
|
127
128
|
else:
|
|
128
|
-
block.declaration
|
|
129
|
+
block.declaration += char
|
|
129
130
|
elif current_state == ParseState.IN_PARAMETER:
|
|
130
131
|
if block.parameter is None:
|
|
131
|
-
block.parameter =
|
|
132
|
+
block.parameter = char
|
|
132
133
|
else:
|
|
133
|
-
block.parameter
|
|
134
|
+
block.parameter += char
|
|
134
135
|
elif current_state == ParseState.IN_PAYLOAD:
|
|
135
136
|
if block.payload is None:
|
|
136
|
-
block.payload =
|
|
137
|
+
block.payload = char
|
|
137
138
|
else:
|
|
138
|
-
block.payload
|
|
139
|
+
block.payload += char
|
|
139
140
|
i += 1
|
|
140
141
|
continue
|
|
141
142
|
|
|
@@ -143,7 +144,7 @@ class TagScriptParser:
|
|
|
143
144
|
if current_state == ParseState.EXPECTING_DECLARATION:
|
|
144
145
|
# {} found, illegal BLOCK node, treat as TEXT
|
|
145
146
|
text = BRACE_OPEN + char
|
|
146
|
-
self._text_buffer
|
|
147
|
+
self._text_buffer += text
|
|
147
148
|
else:
|
|
148
149
|
self._nodes.append(block.finalize())
|
|
149
150
|
self._state = None
|
|
@@ -155,96 +156,96 @@ class TagScriptParser:
|
|
|
155
156
|
|
|
156
157
|
if current_state == ParseState.EXPECTING_DECLARATION:
|
|
157
158
|
block.transition_state(ParseState.IN_DECLARATION)
|
|
158
|
-
block.declaration =
|
|
159
|
+
block.declaration = char
|
|
159
160
|
elif current_state == ParseState.IN_DECLARATION:
|
|
160
161
|
if block.declaration is None:
|
|
161
|
-
block.declaration =
|
|
162
|
+
block.declaration = char
|
|
162
163
|
else:
|
|
163
|
-
block.declaration
|
|
164
|
+
block.declaration += char
|
|
164
165
|
elif current_state == ParseState.IN_PARAMETER:
|
|
165
166
|
if block.parameter is None:
|
|
166
|
-
block.parameter =
|
|
167
|
+
block.parameter = char
|
|
167
168
|
else:
|
|
168
|
-
block.parameter
|
|
169
|
+
block.parameter += char
|
|
169
170
|
elif current_state == ParseState.IN_PAYLOAD:
|
|
170
171
|
if block.payload is None:
|
|
171
|
-
block.payload =
|
|
172
|
+
block.payload = char
|
|
172
173
|
else:
|
|
173
|
-
block.payload
|
|
174
|
+
block.payload += char
|
|
174
175
|
elif current_state == ParseState.POST_PARAMETER:
|
|
175
176
|
# only colon or pop is allowed here, abort the block entirely
|
|
176
|
-
self._text_buffer
|
|
177
|
-
self._text_buffer
|
|
177
|
+
self._text_buffer += _reconstruct_partial_block(block)
|
|
178
|
+
self._text_buffer += char
|
|
178
179
|
self._state = None
|
|
179
180
|
# endregion Closing brace handling
|
|
180
181
|
|
|
181
182
|
elif char == PAREN_OPEN:
|
|
182
183
|
# region Opening paren handling
|
|
183
184
|
if block is None or current_state is None:
|
|
184
|
-
self._text_buffer
|
|
185
|
+
self._text_buffer += char
|
|
185
186
|
i += 1
|
|
186
187
|
continue
|
|
187
188
|
|
|
188
189
|
block.paren_depth += 1
|
|
189
190
|
if current_state == ParseState.EXPECTING_DECLARATION:
|
|
190
191
|
block.transition_state(ParseState.IN_DECLARATION)
|
|
191
|
-
block.declaration =
|
|
192
|
+
block.declaration = char
|
|
192
193
|
elif current_state == ParseState.IN_DECLARATION:
|
|
193
194
|
if block.block_depth == 1:
|
|
194
195
|
block.has_parameter_section = True
|
|
195
196
|
block.transition_state(ParseState.IN_PARAMETER)
|
|
196
197
|
elif block.declaration is None:
|
|
197
|
-
block.declaration =
|
|
198
|
+
block.declaration = char
|
|
198
199
|
else:
|
|
199
|
-
block.declaration
|
|
200
|
+
block.declaration += char
|
|
200
201
|
elif current_state == ParseState.IN_PARAMETER:
|
|
201
202
|
if block.parameter is None:
|
|
202
|
-
block.parameter =
|
|
203
|
+
block.parameter = char
|
|
203
204
|
else:
|
|
204
|
-
block.parameter
|
|
205
|
+
block.parameter += char
|
|
205
206
|
elif current_state == ParseState.IN_PAYLOAD:
|
|
206
207
|
if block.payload is None:
|
|
207
|
-
block.payload =
|
|
208
|
+
block.payload = char
|
|
208
209
|
else:
|
|
209
|
-
block.payload
|
|
210
|
+
block.payload += char
|
|
210
211
|
elif current_state == ParseState.POST_PARAMETER:
|
|
211
212
|
# only colon or pop is allowed here, abort the block entirely
|
|
212
|
-
self._text_buffer
|
|
213
|
-
self._text_buffer
|
|
213
|
+
self._text_buffer += _reconstruct_partial_block(block)
|
|
214
|
+
self._text_buffer += char
|
|
214
215
|
self._state = None
|
|
215
216
|
# endregion Opening paren handling
|
|
216
217
|
|
|
217
218
|
elif char == PAREN_CLOSE:
|
|
218
219
|
# region Closing paren handling
|
|
219
220
|
if block is None or current_state is None:
|
|
220
|
-
self._text_buffer
|
|
221
|
+
self._text_buffer += char
|
|
221
222
|
i += 1
|
|
222
223
|
continue
|
|
223
224
|
|
|
224
225
|
if current_state == ParseState.EXPECTING_DECLARATION:
|
|
225
226
|
block.transition_state(ParseState.IN_DECLARATION)
|
|
226
|
-
block.declaration =
|
|
227
|
+
block.declaration = char
|
|
227
228
|
elif current_state == ParseState.IN_DECLARATION:
|
|
228
229
|
if block.declaration is None:
|
|
229
|
-
block.declaration =
|
|
230
|
+
block.declaration = char
|
|
230
231
|
else:
|
|
231
|
-
block.declaration
|
|
232
|
+
block.declaration += char
|
|
232
233
|
elif current_state == ParseState.IN_PARAMETER:
|
|
233
234
|
if block.paren_depth == 1:
|
|
234
235
|
block.transition_state(ParseState.POST_PARAMETER)
|
|
235
236
|
elif block.parameter is None:
|
|
236
|
-
block.parameter =
|
|
237
|
+
block.parameter = char
|
|
237
238
|
else:
|
|
238
|
-
block.parameter
|
|
239
|
+
block.parameter += char
|
|
239
240
|
elif current_state == ParseState.IN_PAYLOAD:
|
|
240
241
|
if block.payload is None:
|
|
241
|
-
block.payload =
|
|
242
|
+
block.payload = char
|
|
242
243
|
else:
|
|
243
|
-
block.payload
|
|
244
|
+
block.payload += char
|
|
244
245
|
elif current_state == ParseState.POST_PARAMETER:
|
|
245
246
|
# only colon or pop is allowed here, abort the block entirely
|
|
246
|
-
self._text_buffer
|
|
247
|
-
self._text_buffer
|
|
247
|
+
self._text_buffer += _reconstruct_partial_block(block)
|
|
248
|
+
self._text_buffer += char
|
|
248
249
|
self._state = None
|
|
249
250
|
|
|
250
251
|
if block.paren_depth != 0:
|
|
@@ -254,13 +255,13 @@ class TagScriptParser:
|
|
|
254
255
|
elif char == COLON:
|
|
255
256
|
# region Colon handling
|
|
256
257
|
if block is None or current_state is None:
|
|
257
|
-
self._text_buffer
|
|
258
|
+
self._text_buffer += char
|
|
258
259
|
i += 1
|
|
259
260
|
continue
|
|
260
261
|
|
|
261
262
|
if current_state == ParseState.EXPECTING_DECLARATION:
|
|
262
263
|
block.transition_state(ParseState.IN_DECLARATION)
|
|
263
|
-
block.declaration =
|
|
264
|
+
block.declaration = char
|
|
264
265
|
elif (
|
|
265
266
|
current_state
|
|
266
267
|
in (ParseState.IN_DECLARATION, ParseState.POST_PARAMETER)
|
|
@@ -271,21 +272,21 @@ class TagScriptParser:
|
|
|
271
272
|
block.transition_state(ParseState.IN_PAYLOAD)
|
|
272
273
|
elif current_state == ParseState.IN_DECLARATION:
|
|
273
274
|
if block.declaration is None:
|
|
274
|
-
block.declaration =
|
|
275
|
+
block.declaration = char
|
|
275
276
|
else:
|
|
276
|
-
block.declaration
|
|
277
|
+
block.declaration += char
|
|
277
278
|
elif current_state == ParseState.IN_PARAMETER:
|
|
278
279
|
if block.parameter is None:
|
|
279
|
-
block.parameter =
|
|
280
|
+
block.parameter = char
|
|
280
281
|
else:
|
|
281
|
-
block.parameter
|
|
282
|
+
block.parameter += char
|
|
282
283
|
elif current_state == ParseState.IN_PAYLOAD:
|
|
283
284
|
if block.payload is None:
|
|
284
|
-
block.payload =
|
|
285
|
+
block.payload = char
|
|
285
286
|
else:
|
|
286
|
-
block.payload
|
|
287
|
+
block.payload += char
|
|
287
288
|
else:
|
|
288
|
-
self._text_buffer
|
|
289
|
+
self._text_buffer += char
|
|
289
290
|
# endregion Colon handling
|
|
290
291
|
|
|
291
292
|
else:
|
|
@@ -293,38 +294,38 @@ class TagScriptParser:
|
|
|
293
294
|
if block is None or current_state is None:
|
|
294
295
|
# unlikely if not impossible to hit but better safe than sorry
|
|
295
296
|
# (non-special chars are fast-tracked for None block above)
|
|
296
|
-
self._text_buffer
|
|
297
|
+
self._text_buffer += char
|
|
297
298
|
i += 1
|
|
298
299
|
continue
|
|
299
300
|
|
|
300
301
|
if current_state == ParseState.EXPECTING_DECLARATION:
|
|
301
302
|
block.transition_state(ParseState.IN_DECLARATION)
|
|
302
|
-
block.declaration =
|
|
303
|
+
block.declaration = char
|
|
303
304
|
elif current_state == ParseState.IN_DECLARATION:
|
|
304
305
|
if block.declaration is None:
|
|
305
|
-
block.declaration =
|
|
306
|
+
block.declaration = char
|
|
306
307
|
else:
|
|
307
|
-
block.declaration
|
|
308
|
+
block.declaration += char
|
|
308
309
|
elif current_state == ParseState.IN_PARAMETER:
|
|
309
310
|
if block.parameter is None:
|
|
310
|
-
block.parameter =
|
|
311
|
+
block.parameter = char
|
|
311
312
|
else:
|
|
312
|
-
block.parameter
|
|
313
|
+
block.parameter += char
|
|
313
314
|
elif current_state == ParseState.IN_PAYLOAD:
|
|
314
315
|
if block.payload is None:
|
|
315
|
-
block.payload =
|
|
316
|
+
block.payload = char
|
|
316
317
|
else:
|
|
317
|
-
block.payload
|
|
318
|
+
block.payload += char
|
|
318
319
|
elif current_state == ParseState.POST_PARAMETER:
|
|
319
320
|
# only colon or pop is allowed here, abort the block entirely
|
|
320
|
-
self._text_buffer
|
|
321
|
-
self._text_buffer
|
|
321
|
+
self._text_buffer += _reconstruct_partial_block(block)
|
|
322
|
+
self._text_buffer += char
|
|
322
323
|
self._state = None
|
|
323
324
|
# endregion Any other char handling (including BACKSLASH)
|
|
324
325
|
|
|
325
326
|
except ValueError as e:
|
|
326
327
|
_log.warning("Invalid state transition encountered: %r", e)
|
|
327
|
-
self._text_buffer
|
|
328
|
+
self._text_buffer += char
|
|
328
329
|
|
|
329
330
|
i += 1
|
|
330
331
|
# endregion end of processing loop
|
|
@@ -333,7 +334,7 @@ class TagScriptParser:
|
|
|
333
334
|
self._flush_text_buffer()
|
|
334
335
|
if (block := self._state) is not None:
|
|
335
336
|
raw_partial_block = _reconstruct_partial_block(block)
|
|
336
|
-
self._text_buffer
|
|
337
|
+
self._text_buffer += raw_partial_block
|
|
337
338
|
self._flush_text_buffer()
|
|
338
339
|
self._state = None
|
|
339
340
|
|
|
@@ -347,19 +348,21 @@ class TagScriptParser:
|
|
|
347
348
|
else:
|
|
348
349
|
text = "".join(self._text_buffer)
|
|
349
350
|
self._nodes.append(Node.text(text_value=text))
|
|
350
|
-
self._text_buffer =
|
|
351
|
+
self._text_buffer = ""
|
|
351
352
|
|
|
352
353
|
|
|
353
354
|
def _reconstruct_partial_block(block: BlockParseState) -> str:
|
|
354
355
|
"""Reconstructs a partial block as text for error recovery."""
|
|
355
|
-
|
|
356
|
+
out = BRACE_OPEN
|
|
357
|
+
if block.declaration is not None:
|
|
358
|
+
out += block.declaration
|
|
356
359
|
if block.has_parameter_section:
|
|
357
|
-
|
|
360
|
+
out += PAREN_OPEN
|
|
358
361
|
if block.parameter is not None:
|
|
359
|
-
|
|
360
|
-
|
|
362
|
+
out += block.parameter
|
|
363
|
+
out += PAREN_CLOSE
|
|
361
364
|
if block.has_payload_section:
|
|
362
|
-
|
|
365
|
+
out += COLON
|
|
363
366
|
if block.payload is not None:
|
|
364
|
-
|
|
365
|
-
return
|
|
367
|
+
out += block.payload
|
|
368
|
+
return out
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|