Commit Graph

11 Commits

Author SHA1 Message Date
patrick96 50f127f1bc Cleanup 2021-02-12 20:01:22 +01:00
patrick96 c4fbf0023e Move action_context into separate file 2021-02-12 20:01:22 +01:00
patrick96 7a9f301830 Throw exception for unclosed action tags 2021-02-12 20:01:22 +01:00
patrick96 cd1d4fa183 Stop tracking action blocks in renderer
Dispatch can now directly get the current position from the renderer and
create action blocks with the proper coordinates.
2021-02-12 20:01:22 +01:00
patrick96 7a569c4b98 Remove mousebtn argument from action_open 2021-02-12 20:01:22 +01:00
patrick96 464bedb33c Store all action info in action_context
The renderer is responsible for setting the start and end positions
while dispatch does the rest
2021-02-12 20:01:22 +01:00
patrick96 f359540b5d renderer: Move change_alignment into interface 2021-02-12 20:01:22 +01:00
patrick96 96239597ed Move most action state out of renderer
The renderer now only stores the positions of the actions because that
is specific to the renderer and because the actual position can only be
finalized after all the rendering is done because intitially the
positions are relative to the alignment and not the bar.
2021-02-12 20:01:22 +01:00
patrick96 0a474bb2f2 Move trivial formatting state into tags::context
The variables storing the current colors, attribute activations and font
were only used in a single place and can easily also be read from the
context.

This allows us to remove a lot of the state of the renderer.
2021-02-12 20:01:22 +01:00
patrick96 5d518e171e renderer: Use interface to render offset 2021-02-12 20:01:22 +01:00
Patrick Ziegler fd556525a8
New Tag Parser (#2303)
* refactor(color): Use enum class for color type

* Add testcases for tag parser

* Make tag parser a pull-style parser

Being able to parse single elements at a time gives us more fine-grained
error messages, we can also parse as much as possible and only stop
after an exception.

* fix(color): Parser did not check for invalid chars

* tag parser: First full implementation

* tag parser: Fix remaining failing tests

* tag parser: Replace old parser

* tag parser: Treat alignment as formatting tag

Makes the structure less complex and the alignment tags really are
formatting tags, they are structurally no different from the %{R} tag.

* tag parser: Cleanup type definitions

All type definitions for tags now live in tags/types.hpp, the parser.hpp
only contains the definitions necessary for actually calling the parser,
this shouldn't be included in many places (only places that actually do
parsing). But many places need the definitions for the tags themselves.

* Rename components/parser to tags/dispatch

* tag parser: Cleanup

* Add changelog
2020-12-17 20:37:28 +01:00