mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-27 11:37:59 -06:00
hayro-cmap reads CMap streams with hayro-postscript's token scanner, whose object::read skipped each `<<` and `>>` by calling itself again. A CMap holding a long run of `<` or `>` used one stack frame per pair, overflowed the stack and aborted the process. Vendor hayro-postscript 0.1.0 with read() looping over the delimiters instead (from storytold/craft-libs#263), patched in beside hayro-cmap. Four object::tests cover long `<<` and `>>` runs and the skipped delimiters, plain and nested.
31 lines
1.1 KiB
Markdown
31 lines
1.1 KiB
Markdown
# hayro-postscript
|
|
|
|
[](https://crates.io/crates/hayro-postscript)
|
|
[](https://docs.rs/hayro-postscript)
|
|
|
|
<!-- cargo-rdme start -->
|
|
|
|
A lightweight PostScript scanner.
|
|
|
|
This crate provides a scanner for tokenizing PostScript programs into typed objects.
|
|
It currently only implements a very small subset of the PostScript language,
|
|
with the main goal of being enough to parse CMAP files, but the scope _might_
|
|
be expanded upon in the future.
|
|
|
|
The supported types include integers and real numbers, name objects, strings and arrays.
|
|
Unsupported is anything else, including dictionaries, procedures, etc. An error
|
|
will be returned in case any of these is encountered.
|
|
|
|
### Safety
|
|
This crate forbids unsafe code via a crate-level attribute.
|
|
|
|
<!-- cargo-rdme end -->
|
|
|
|
## License
|
|
Licensed under either of
|
|
|
|
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
|
|
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
|
|
|
|
at your option.
|