aboutsummaryrefslogtreecommitdiff
path: root/src/definitions.rs
Commit message (Collapse)AuthorAge
* Rewrite table based state change to `match` basedKirill Chibisov2025-01-12
| | | | | | | | | | | | | | | The table based state change was too complex to make guesses why it's getting slow and too fragile, as in modifying the amount of states/actions were slowing down, even though, they were not used. Rewrite the state + action change exactly how it's in [1] with respect to our modifications/C1, etc. The new implementation is generally faster than the previous one and is easier for compiler to reason about and generate more efficient structures. Also, the structure got way simpler to follow, since it matches the spec pretty much exactly. [1] - https://vt100.net/emu/dec_ansi_parser
* Switch parser to multi-byte processingChristian Duerr2025-01-09
| | | | | | | | | | | | | | | | | | | | | This patch overhauls the `Parser::advance` API to operate on byte slices instead of individual bytes, which allows for additional performance optimizations. VTE does not support C1 escapes and C0 escapes always start with an escape character. This makes it possible to simplify processing if a byte stream is determined to not contain any escapes. The `memchr` crate provides a battle-tested implementation for SIMD-accelerated byte searches, which is why this implementation makes use of it. VTE also only supports UTF8 characters in the ground state, which means that the new non-escape parsing path is able to rely completely on STD's `str::from_utf8` since `memchr` gives us the full length of the plain text character buffer. This allows us to completely remove `utf8parse` and all related code. We also make use of `memchr` in the synchronized escape handling in `ansi.rs`, since it relies heavily on scanning large amounts of text for the extension/termination escape sequences.
* Improve attrs_from_sgr_parameters performanceKirill Chibisov2024-12-29
| | | | Instead of collecting all the data into the vector just dispatch it right away avoiding allocations.
* Ensure proper enum representationEthan Pailes2023-11-04
|
* Migrate `ansi` from `alacritty_terminal`Anhad Singh2023-05-14
| | | | | | Signed-off-by: Andy-Python-Programmer <andypythonappdeveloper@gmail.com> Signed-off-by: Anhad Singh <andypythonappdeveloper@gmail.com> Co-authored-by: Nicholas Sim <nsim@posteo.net> Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Improve parser performanceChristian Duerr2020-07-27
|
* Pass terminator to osc dispatcherChristian Duerr2020-01-29
| | | | | | | | | | | | | | Even though the ST terminator is the only officially supported terminator, some applications still rely on BEL to work properly. Both have been supported historically, however there was no way for the terminal to tell which terminator was used. Since OSC escapes frequently offer the `?` parameter to query for the current format, some applications expect the response terminator to match the request terminator. To make it possible to support this, the osc_dispatcher is now informed when the BEL terminator was used. Since the C1 ST terminator was not yet supported for OSC escapes, support for it has also been added.
* Remove table generationChristian Duerr2019-12-10
| | | | | | | | | | | | | | | This completely removes the `codegen` project, which relied on outdated libraries to parse DSLs to build the utf8 and vte state tables, to make the library easier to maintain. The utf8 table could be completely removed in favor of a `match` statement, which also lead to a performance improvement with the utf8 parser. The vte table did not benefit from `match` statements at all and instead had significantly worse performance with it. To replace the old codegeneration for vte, the `generate_state_changes` crate has been created instead, which uses the language's proc_macro feature to create a `const fn` which will generate the table at compile time.
* Update to Rust 2018Christian Duerr2019-11-23
| | | | | | This moves all crates in the workspace to the latest Rust standard and resolves various style and formatting issues. Fixes #32.
* no_std (#9)M Farkas-Dyck2017-11-18
|
* Rename and document vte crateJoe Wilm2016-09-17
|
* Add support for UTF-8Joe Wilm2016-09-17
| | | | | | | | | | | This adds a table-driven UTF-8 parser which only has a single branch for the entire parser. UTF-8 support is essentially bolted onto the VTE parser. Not the most elegant, but it does prevent the transition tables from blowing up. Instead of refactoring the syntax extension to handle both table definitions, I've opted to copy/paste now for both simplicities sake and because I can't see a clear path to a minimal shared solution.
* Expand unpack state/action testsJoe Wilm2016-09-16
|
* Fix some commentsJoe Wilm2016-09-16
|
* Finish implementing codegen for state tableJoe Wilm2016-09-13
| | | | | | When modifying table.rs.in, `cargo run` must be run in the `codegen` crate. The result of expansion is included in the source tree so that consumers don't need to pull in syntex just to compile.
* WIPJoe Wilm2016-09-12