| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
std::encoding::xml - XML 1.0 parser and writer based on Yxml (#3154) * std::encoding::xml - XML 1.0 parser and writer based on Yxml based on Yxml <https://dev.yorhel.nl/yxml> Native port of the Yxml C library. Provides a low-level streaming parser and a high-level DOM API. What it DOES NOT do (Limitations): - No DTD/Schema validation. - No custom entity references (only standard &, <, etc.). - No namespace assistance (prefixes are kept in the name). - No XPath or XSLT. - No verification of Unicode ranges (assumes valid input). - No attribute uniqueness checks. API & Implementation: - XmlReader: Low-level streaming parser that works with any InStream. - XmlWriter: XML serializer that integrates with any OutStream. - XmlDocument: High-level DOM API for loading, searching, and modifying XML. - Internal: The `internal::Parser` contains the core ported state-machine from Yxml. Usage Examples: https://github.com/c3lang/c3c/tree/master/resources/examples/xml/ * stdlib styling * `inline int` the constdef `constdef State` now `constdef State : inline int` * constdef to enum and finish allman style * styling * use allocator for parser stack and add stack_size parameter DEFAULT_STACK_SIZE = 4096 per yxml recommendation * changed `Ret` to be a standard c3 enum * cache the Stream function pointers aprox ~15% boost some more refactoring add a little io buffer and inline the state machine * take the type directly from the interface method * Refactorings, fix benchmarks, add releasenotes. --------- Co-authored-by: Christoffer Lerno <christoffer@aegik.com> | 5 个月前 | |
json: add unmarshaling support, clean up DOM parsing, and add benchmarks (#3384) * json: add unmarshaling support, clean up DOM parsing, and add benchmarks - Added `unmarshal` (JSON string to struct) and `@unmarshal_to` (Object* to struct). - Simplified DOM parsing. - Sped up serialization. - Added benchmarks for marshaling, unmarshaling, and DOM parsing. - Updated unit tests. * add serialize_object() and an example on `resources/examples/json_pretty_print.c3` * complete the benchmarks * fixes: fix array bounds, add vector support, and clean up redundancies * Some refactoring. * Rename Indent. Add tests. * continuing work * Some formatting. * Update releasenotes * Refactoring, moving unmarshaling partly to object. Object .is_empty is also .is_map. Improve backwards compatibility. Release memory on failure. --------- Co-authored-by: Christoffer Lerno <christoffer@aegik.com> | 2 个月前 | |
add `std::encoding::regex` implementation (#3369) * add `std::encoding::regex` implementation - based on https://git.musl-libc.org/cgit/musl/tree/src/regex/regcomp.c - added tests and benchmarks against libc regex * make ctx init explicit for future optimization * fix TODO for NOT null-terminated string and test * change `have_backrefs` and `nullable` to bool add useful comment on BRE backreferences * tre_fill_pmatch refactoring * add `StateId` and `TagId` types to prevent sem-mixing of int identifiers * add a few @param contracts for _some_ pointer safty * done * add bound check to `is_word_char()` * update Documentation for module * a few more benchmarks * fix a few regressions I introduced * follow stdlib pattern: start with the allocator and non implicit update tests/benchmark use String.zstr_copy, and ZString in the engine * rename nmatch to max_captures * add a few more APIs and tests more refactor, and a bunch of optimizations * remove setjmp contract test TODO: this * add an http server regex tester * a few more APIs and some refactoring * Update regex doc example * Make it clearly experimental: let people try out the API before we freeze it for 0.8.x --------- Co-authored-by: Christoffer Lerno <christoffer@aegik.com> | 2 个月前 | |
std::encoding::xml - XML 1.0 parser and writer based on Yxml (#3154) * std::encoding::xml - XML 1.0 parser and writer based on Yxml based on Yxml <https://dev.yorhel.nl/yxml> Native port of the Yxml C library. Provides a low-level streaming parser and a high-level DOM API. What it DOES NOT do (Limitations): - No DTD/Schema validation. - No custom entity references (only standard &, <, etc.). - No namespace assistance (prefixes are kept in the name). - No XPath or XSLT. - No verification of Unicode ranges (assumes valid input). - No attribute uniqueness checks. API & Implementation: - XmlReader: Low-level streaming parser that works with any InStream. - XmlWriter: XML serializer that integrates with any OutStream. - XmlDocument: High-level DOM API for loading, searching, and modifying XML. - Internal: The `internal::Parser` contains the core ported state-machine from Yxml. Usage Examples: https://github.com/c3lang/c3c/tree/master/resources/examples/xml/ * stdlib styling * `inline int` the constdef `constdef State` now `constdef State : inline int` * constdef to enum and finish allman style * styling * use allocator for parser stack and add stack_size parameter DEFAULT_STACK_SIZE = 4096 per yxml recommendation * changed `Ret` to be a standard c3 enum * cache the Stream function pointers aprox ~15% boost some more refactoring add a little io buffer and inline the state machine * take the type directly from the interface method * Refactorings, fix benchmarks, add releasenotes. --------- Co-authored-by: Christoffer Lerno <christoffer@aegik.com> | 5 个月前 |