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.
Files changed (195) hide show
  1. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/.github/workflows/black.yml +1 -1
  2. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/.pre-commit-config.yaml +1 -1
  3. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/CHANGELOG.md +10 -0
  4. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/PKG-INFO +3 -3
  5. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/README.md +2 -2
  6. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/conf.py +1 -1
  7. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/pyproject.toml +1 -1
  8. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interpreter/interpreter.py +37 -6
  9. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interpreter/parse_state.py +30 -21
  10. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interpreter/ts_parser.py +83 -80
  11. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/.github/dependabot.yml +0 -0
  12. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/.github/workflows/publish.yml +0 -0
  13. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/.github/workflows/test.yml +0 -0
  14. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/.gitignore +0 -0
  15. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/.python-version +0 -0
  16. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/.readthedocs.yaml +0 -0
  17. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/LICENSE.md +0 -0
  18. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/Makefile +0 -0
  19. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/_ext/glossary_backlink_checker.py +0 -0
  20. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/_ext/styled_list_directive.py +0 -0
  21. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/adapters.rst +0 -0
  22. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/blocks.rst +0 -0
  23. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/changelog.rst +0 -0
  24. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/code_examples/adapters/int_adapter_example.py +0 -0
  25. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/code_examples/adapters/member_adapter_example.py +0 -0
  26. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/code_examples/nested_blocks_example.py +0 -0
  27. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/code_examples/quickstart_example.py +0 -0
  28. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/credits.rst +0 -0
  29. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/exceptions.rst +0 -0
  30. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/glossary.rst +0 -0
  31. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/index.rst +0 -0
  32. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/interfaces.rst +0 -0
  33. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/interpreter.rst +0 -0
  34. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/intro.rst +0 -0
  35. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/make.bat +0 -0
  36. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/numeric_parser.rst +0 -0
  37. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/quickstart.rst +0 -0
  38. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/docs/requirements.txt +0 -0
  39. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/make_release.py +0 -0
  40. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/__init__.py +0 -0
  41. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/__init__.py +0 -0
  42. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/discord_adapters/__init__.py +0 -0
  43. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/discord_adapters/attribute_adapter.py +0 -0
  44. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/discord_adapters/channel_adapter.py +0 -0
  45. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/discord_adapters/guild_adapter.py +0 -0
  46. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/discord_adapters/member_adapter.py +0 -0
  47. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/function_adapter.py +0 -0
  48. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/int_adapter.py +0 -0
  49. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/object_adapter.py +0 -0
  50. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/adapters/string_adapter.py +0 -0
  51. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/__init__.py +0 -0
  52. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/actions/__init__.py +0 -0
  53. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/actions/command_block.py +0 -0
  54. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/actions/delete_block.py +0 -0
  55. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/actions/override_block.py +0 -0
  56. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/actions/react_block.py +0 -0
  57. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/actions/redirect_block.py +0 -0
  58. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/actions/silence_block.py +0 -0
  59. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/conditional/__init__.py +0 -0
  60. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/conditional/all_block.py +0 -0
  61. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/conditional/any_block.py +0 -0
  62. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/conditional/if_block.py +0 -0
  63. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/discord/__init__.py +0 -0
  64. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/discord/cooldown_block.py +0 -0
  65. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/discord/embed_block.py +0 -0
  66. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/flow/__init__.py +0 -0
  67. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/flow/break_block.py +0 -0
  68. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/flow/shortcutredirect_block.py +0 -0
  69. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/flow/stop_block.py +0 -0
  70. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/limiters/__init__.py +0 -0
  71. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/limiters/blacklist_block.py +0 -0
  72. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/limiters/require_block.py +0 -0
  73. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/lists/__init__.py +0 -0
  74. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/lists/cycle_block.py +0 -0
  75. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/lists/list_block.py +0 -0
  76. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/math/__init__.py +0 -0
  77. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/math/math_block.py +0 -0
  78. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/math/ordinal_block.py +0 -0
  79. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/meta/__init__.py +0 -0
  80. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/meta/comment_block.py +0 -0
  81. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/meta/debug_block.py +0 -0
  82. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/rng/__init__.py +0 -0
  83. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/rng/fiftyfifty_block.py +0 -0
  84. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/rng/random_block.py +0 -0
  85. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/rng/range_block.py +0 -0
  86. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/strings/__init__.py +0 -0
  87. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/strings/case_block.py +0 -0
  88. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/strings/join_block.py +0 -0
  89. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/strings/python_block.py +0 -0
  90. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/strings/replace_block.py +0 -0
  91. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/strings/substring_block.py +0 -0
  92. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/strings/urldecode_block.py +0 -0
  93. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/strings/urlencode_block.py +0 -0
  94. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/time/__init__.py +0 -0
  95. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/time/strf_block.py +0 -0
  96. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/time/timedelta_block.py +0 -0
  97. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/variables/__init__.py +0 -0
  98. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/variables/assign_block.py +0 -0
  99. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/variables/loose_variable_getter_block.py +0 -0
  100. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/blocks/variables/strict_variable_getter_block.py +0 -0
  101. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/exceptions/__init__.py +0 -0
  102. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/exceptions/exceptions.py +0 -0
  103. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interfaces/__init__.py +0 -0
  104. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interfaces/adapterabc.py +0 -0
  105. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interfaces/blockabc.py +0 -0
  106. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interfaces/interpreterabc.py +0 -0
  107. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interfaces/nodeabc.py +0 -0
  108. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interpreter/__init__.py +0 -0
  109. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interpreter/context.py +0 -0
  110. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interpreter/node.py +0 -0
  111. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/interpreter/response.py +0 -0
  112. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/py.typed +0 -0
  113. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/util/__init__.py +0 -0
  114. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/util/conditionals.py +0 -0
  115. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/util/escaping.py +0 -0
  116. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/src/ya_tagscript/util/splitter.py +0 -0
  117. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/.coveragerc +0 -0
  118. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/__init__.py +0 -0
  119. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/docs/__init__.py +0 -0
  120. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/docs/code_examples/__init__.py +0 -0
  121. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/docs/code_examples/adapters/__init__.py +0 -0
  122. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/docs/code_examples/adapters/test_int_adapter_example.py +0 -0
  123. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/docs/code_examples/adapters/test_member_adapter_example.py +0 -0
  124. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/docs/code_examples/test_nested_blocks_example.py +0 -0
  125. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/docs/code_examples/test_quickstart_example.py +0 -0
  126. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/__init__.py +0 -0
  127. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/__init__.py +0 -0
  128. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/discord_adapters/__init__.py +0 -0
  129. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/discord_adapters/test_attribute_adapter.py +0 -0
  130. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/discord_adapters/test_channel_adapter.py +0 -0
  131. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/discord_adapters/test_guild_adapter.py +0 -0
  132. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/discord_adapters/test_member_adapter.py +0 -0
  133. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/test_function_adapter.py +0 -0
  134. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/test_int_adapter.py +0 -0
  135. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/test_object_adapter.py +0 -0
  136. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/adapters/test_string_adapter.py +0 -0
  137. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/__init__.py +0 -0
  138. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/actions/__init__.py +0 -0
  139. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/actions/test_command_block.py +0 -0
  140. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/actions/test_delete_block.py +0 -0
  141. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/actions/test_override_block.py +0 -0
  142. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/actions/test_react_block.py +0 -0
  143. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/actions/test_redirect_block.py +0 -0
  144. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/actions/test_silence_block.py +0 -0
  145. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/conditional/__init__.py +0 -0
  146. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/conditional/test_all_block.py +0 -0
  147. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/conditional/test_any_block.py +0 -0
  148. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/conditional/test_if_block.py +0 -0
  149. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/discord/__init__.py +0 -0
  150. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/discord/test_cooldown_block.py +0 -0
  151. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/discord/test_embed_block.py +0 -0
  152. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/flow/__init__.py +0 -0
  153. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/flow/test_break_block.py +0 -0
  154. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/flow/test_shortcutredirect_block.py +0 -0
  155. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/flow/test_stop_block.py +0 -0
  156. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/limiters/__init__.py +0 -0
  157. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/limiters/test_blacklist_block.py +0 -0
  158. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/limiters/test_require_block.py +0 -0
  159. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/lists/__init__.py +0 -0
  160. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/lists/test_cycle_block.py +0 -0
  161. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/lists/test_list_block.py +0 -0
  162. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/math/__init__.py +0 -0
  163. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/math/test_math_block.py +0 -0
  164. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/math/test_ordinal_block.py +0 -0
  165. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/meta/__init__.py +0 -0
  166. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/meta/test_comment_block.py +0 -0
  167. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/meta/test_debug_block.py +0 -0
  168. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/rng/__init__.py +0 -0
  169. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/rng/test_fiftyfifty_block.py +0 -0
  170. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/rng/test_random_block.py +0 -0
  171. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/rng/test_range_block.py +0 -0
  172. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/strings/__init__.py +0 -0
  173. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/strings/test_case_block.py +0 -0
  174. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/strings/test_join_block.py +0 -0
  175. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/strings/test_python_block.py +0 -0
  176. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/strings/test_replace_block.py +0 -0
  177. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/strings/test_substring_block.py +0 -0
  178. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/strings/test_urldecode_block.py +0 -0
  179. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/strings/test_urlencode_block.py +0 -0
  180. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/time/__init__.py +0 -0
  181. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/time/test_strf_block.py +0 -0
  182. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/time/test_timedelta_block.py +0 -0
  183. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/variables/__init__.py +0 -0
  184. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/variables/test_assign_block.py +0 -0
  185. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/variables/test_loose_variable_getter_block.py +0 -0
  186. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/blocks/variables/test_strict_variable_getter_block.py +0 -0
  187. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/interpreter/__init__.py +0 -0
  188. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/interpreter/test_interpreter.py +0 -0
  189. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/interpreter/test_node.py +0 -0
  190. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/interpreter/test_parse_state.py +0 -0
  191. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/interpreter/test_ts_parser.py +0 -0
  192. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/util/__init__.py +0 -0
  193. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/util/test_conditionals.py +0 -0
  194. {ya_tagscript-1.6.2 → ya_tagscript-1.6.4}/tests/ya_tagscript/util/test_escaping.py +0 -0
  195. {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@c6755bb741b6481d6b3d3bb563c83fa060db96c9 # 26.3.1
18
+ uses: psf/black@87928e6d6761a4a6d22250e1fee5601b3998086e # 26.5.1
19
19
  with:
20
20
  options: '--check --diff --verbose'
21
21
  src: '.'
@@ -25,7 +25,7 @@ repos:
25
25
  - id: add-trailing-comma
26
26
 
27
27
  - repo: https://github.com/psf/black-pre-commit-mirror
28
- rev: 26.3.1
28
+ rev: 26.5.0
29
29
  hooks:
30
30
  - id: black
31
31
 
@@ -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.2
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.2
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.2
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.2
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.2
65
+ pip install git+https://github.com/MajorTanya/ya_tagscript.git@v1.6.4
66
66
  ```
67
67
 
68
68
  <!--VERSIONED TAG SECTION END-->
@@ -17,7 +17,7 @@ project_copyright = "2025, MajorTanya"
17
17
  author = "MajorTanya"
18
18
 
19
19
  ### VERSION SECTION START
20
- version = "1.6.2"
20
+ version = "1.6.4"
21
21
  ### VERSION SECTION END
22
22
  release = version
23
23
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "ya_tagscript"
7
- version = "1.6.2"
7
+ version = "1.6.4"
8
8
  description = "Yet Another TagScript fork. An easy drop in user-provided Templating system."
9
9
  readme = "README.md"
10
10
  license = "CC-BY-4.0"
@@ -26,7 +26,14 @@ _logger = logging.getLogger(__name__)
26
26
 
27
27
  class TagScriptInterpreter(InterpreterABC):
28
28
 
29
- __slots__ = ("blocks", "_parser", "work_limit", "total_work")
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: list[str] = []
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.append(node_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 = [e.message]
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 "".join(output)
127
+ return output
107
128
 
108
129
  def _process_context(self, ctx: Context) -> str | None:
109
- for b in self.blocks:
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: list[str] | None = None
47
- parameter: list[str] | None = None
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: list[str] | None = None
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 = "".join(self.parameter) if self.parameter is not None else None
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 = "".join(self.payload) if self.payload is not None else None
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="".join(self.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 not next_state in VALID_TRANSITIONS.get(self.state.value, frozenset()):
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: list[str] = []
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 = input_str[max(i - 1, 0)]
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.append(text)
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.append(char)
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 = [char]
94
+ block.declaration = char
94
95
  elif current_state == ParseState.IN_DECLARATION:
95
96
  if block.declaration is None:
96
- block.declaration = [char]
97
+ block.declaration = char
97
98
  else:
98
- block.declaration.append(char)
99
+ block.declaration += char
99
100
  elif current_state == ParseState.IN_PARAMETER:
100
101
  if block.parameter is None:
101
- block.parameter = [char]
102
+ block.parameter = char
102
103
  else:
103
- block.parameter.append(char)
104
+ block.parameter += char
104
105
  elif current_state == ParseState.IN_PAYLOAD:
105
106
  if block.payload is None:
106
- block.payload = [char]
107
+ block.payload = char
107
108
  else:
108
- block.payload.append(char)
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.append(_reconstruct_partial_block(block))
112
- self._text_buffer.append(char)
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.append(char)
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 = [char]
127
+ block.declaration = char
127
128
  else:
128
- block.declaration.append(char)
129
+ block.declaration += char
129
130
  elif current_state == ParseState.IN_PARAMETER:
130
131
  if block.parameter is None:
131
- block.parameter = [char]
132
+ block.parameter = char
132
133
  else:
133
- block.parameter.append(char)
134
+ block.parameter += char
134
135
  elif current_state == ParseState.IN_PAYLOAD:
135
136
  if block.payload is None:
136
- block.payload = [char]
137
+ block.payload = char
137
138
  else:
138
- block.payload.append(char)
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.append(text)
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 = [char]
159
+ block.declaration = char
159
160
  elif current_state == ParseState.IN_DECLARATION:
160
161
  if block.declaration is None:
161
- block.declaration = [char]
162
+ block.declaration = char
162
163
  else:
163
- block.declaration.append(char)
164
+ block.declaration += char
164
165
  elif current_state == ParseState.IN_PARAMETER:
165
166
  if block.parameter is None:
166
- block.parameter = [char]
167
+ block.parameter = char
167
168
  else:
168
- block.parameter.append(char)
169
+ block.parameter += char
169
170
  elif current_state == ParseState.IN_PAYLOAD:
170
171
  if block.payload is None:
171
- block.payload = [char]
172
+ block.payload = char
172
173
  else:
173
- block.payload.append(char)
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.append(_reconstruct_partial_block(block))
177
- self._text_buffer.append(char)
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.append(char)
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 = [char]
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 = [char]
198
+ block.declaration = char
198
199
  else:
199
- block.declaration.append(char)
200
+ block.declaration += char
200
201
  elif current_state == ParseState.IN_PARAMETER:
201
202
  if block.parameter is None:
202
- block.parameter = [char]
203
+ block.parameter = char
203
204
  else:
204
- block.parameter.append(char)
205
+ block.parameter += char
205
206
  elif current_state == ParseState.IN_PAYLOAD:
206
207
  if block.payload is None:
207
- block.payload = [char]
208
+ block.payload = char
208
209
  else:
209
- block.payload.append(char)
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.append(_reconstruct_partial_block(block))
213
- self._text_buffer.append(char)
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.append(char)
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 = [char]
227
+ block.declaration = char
227
228
  elif current_state == ParseState.IN_DECLARATION:
228
229
  if block.declaration is None:
229
- block.declaration = [char]
230
+ block.declaration = char
230
231
  else:
231
- block.declaration.append(char)
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 = [char]
237
+ block.parameter = char
237
238
  else:
238
- block.parameter.append(char)
239
+ block.parameter += char
239
240
  elif current_state == ParseState.IN_PAYLOAD:
240
241
  if block.payload is None:
241
- block.payload = [char]
242
+ block.payload = char
242
243
  else:
243
- block.payload.append(char)
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.append(_reconstruct_partial_block(block))
247
- self._text_buffer.append(char)
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.append(char)
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 = [char]
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 = [char]
275
+ block.declaration = char
275
276
  else:
276
- block.declaration.append(char)
277
+ block.declaration += char
277
278
  elif current_state == ParseState.IN_PARAMETER:
278
279
  if block.parameter is None:
279
- block.parameter = [char]
280
+ block.parameter = char
280
281
  else:
281
- block.parameter.append(char)
282
+ block.parameter += char
282
283
  elif current_state == ParseState.IN_PAYLOAD:
283
284
  if block.payload is None:
284
- block.payload = [char]
285
+ block.payload = char
285
286
  else:
286
- block.payload.append(char)
287
+ block.payload += char
287
288
  else:
288
- self._text_buffer.append(char)
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.append(char)
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 = [char]
303
+ block.declaration = char
303
304
  elif current_state == ParseState.IN_DECLARATION:
304
305
  if block.declaration is None:
305
- block.declaration = [char]
306
+ block.declaration = char
306
307
  else:
307
- block.declaration.append(char)
308
+ block.declaration += char
308
309
  elif current_state == ParseState.IN_PARAMETER:
309
310
  if block.parameter is None:
310
- block.parameter = [char]
311
+ block.parameter = char
311
312
  else:
312
- block.parameter.append(char)
313
+ block.parameter += char
313
314
  elif current_state == ParseState.IN_PAYLOAD:
314
315
  if block.payload is None:
315
- block.payload = [char]
316
+ block.payload = char
316
317
  else:
317
- block.payload.append(char)
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.append(_reconstruct_partial_block(block))
321
- self._text_buffer.append(char)
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.append(char)
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.append(raw_partial_block)
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
- parts: list[str] = [BRACE_OPEN, "".join(block.declaration or [])]
356
+ out = BRACE_OPEN
357
+ if block.declaration is not None:
358
+ out += block.declaration
356
359
  if block.has_parameter_section:
357
- parts.append(PAREN_OPEN)
360
+ out += PAREN_OPEN
358
361
  if block.parameter is not None:
359
- parts.append("".join(block.parameter))
360
- parts.append(PAREN_CLOSE)
362
+ out += block.parameter
363
+ out += PAREN_CLOSE
361
364
  if block.has_payload_section:
362
- parts.append(COLON)
365
+ out += COLON
363
366
  if block.payload is not None:
364
- parts.append("".join(block.payload))
365
- return "".join(parts)
367
+ out += block.payload
368
+ return out
File without changes
File without changes