Commit Graph

511 Commits

Author SHA1 Message Date
Kogia-sima 28b5c6abd1 Generate more readable code 2020-12-19 20:51:01 +09:00
Kogia-sima fa198107a0 fix: Do not panic when buffer size decreased 2020-12-19 20:42:03 +09:00
Kogia-sima ee1952c2eb feat: impl Send/Sync for Buffer 2020-12-19 18:21:48 +09:00
Kogia-sima 70033d604d break: forbit implementing TemplateOnce trait by hand 2020-12-19 17:38:57 +09:00
Kogia-sima c6a3985dfd perf: optimize simd escaping for small strings 2020-12-19 16:58:36 +09:00
Kogia-sima 15f397348a refactor: Organize source code for readability 2020-12-18 23:00:40 +09:00
Kogia-sima 21fc4af83a doc: comments for feature flags 2020-12-18 19:45:46 +09:00
Kogia-sima f98ed7426f clippy fix 2020-12-18 19:23:20 +09:00
Kogia-sima bf55dd7909 Branch optimization in naive escape 2020-12-18 18:28:21 +09:00
Kogia-sima fe11aff782 Merge branch 'feature/json-filter' 2020-12-18 12:24:43 +09:00
Kogia-sima 28eb155991 Downgrade serde version 2020-12-18 12:21:57 +09:00
Kogia-sima 90910d7acd Merge branch 'feature/truncate-filter' 2020-12-18 12:16:32 +09:00
Kogia-sima 1d6e129bcb test: Add test for truncate filter 2020-12-18 11:25:01 +09:00
Kogia-sima d381552e6b feat: truncate filter 2020-12-18 11:13:14 +09:00
Kogia-sima 47c09e4f55 refactor: Remove dbg!() 2020-12-18 11:03:44 +09:00
Kogia-sima 06e34cf9d5 test: Add test for trim, lower and upper filters 2020-12-17 19:54:21 +09:00
Kogia-sima e71dc3c8ca test: Add test for json filter 2020-12-17 19:47:33 +09:00
Kogia-sima e899e99ea1 doc: json filter documentation 2020-12-17 19:47:33 +09:00
Kogia-sima d7bce02109 feat: json filter 2020-12-17 19:47:27 +09:00
Kogia-sima 8e07927f19 Add doc_cfg attribute 2020-12-17 17:06:34 +09:00
Kogia-sima daa6f4878d Rename some tests 2020-12-17 16:30:47 +09:00
Kogia-sima e316c82eb5 Remove String::truncate()
Current implementation is unsafe because it doesn't check if `new_len`
does lie on a char boundary.
2020-12-17 16:24:57 +09:00
Kogia-sima 2884146359 Merge branch 'fix/continue-break/#21' 2020-12-17 15:51:39 +09:00
Kogia-sima cff4fa9484 Merge branch 'ci/github-workflow' 2020-12-17 15:51:28 +09:00
Kogia-sima edff2b4ef0 Update status badge 2020-12-17 15:50:47 +09:00
Kogia-sima 92a79b769f Remove Travis/Appvayor CI configuration 2020-12-17 15:47:02 +09:00
Kogia-sima 53a9cb9713 fix error with cargo-miri 2020-12-17 15:38:11 +09:00
Kogia-sima b6487358ec GitHub Actions: Add test.yml 2020-12-17 14:41:00 +09:00
Kogia-sima de1de2b0e8 Add continue-break test 2020-12-17 13:44:27 +09:00
Kogia-sima e221a9b8b9 fix: Fix rendering issue on continue/break statements
fix #21
2020-12-17 13:28:40 +09:00
Kogia-sima 18ffe5b321 Remove benchmarks
Remove benchmark programs in favor of https://github.com/djc/template-benchmarks-rs

* Quite similar contents
* Some library has too heavy dependencies and frequently cause breaking
changes (which always results in tiny performance difference)
* Some benchmark implementation is out of date
* There is a persistent complaint that the benchmark is wrong (although
I'm not still convinced)

cc #28 #37
2020-12-17 12:51:42 +09:00
Kogia-sima 5961a7400b security: Properly handle slices with size greater than isize::MAX
See https://github.com/rust-lang/rust/pull/79930#issuecomment-747135498
for more details.
2020-12-17 10:24:28 +09:00
Kogia-sima 5108988879 Use std::isize::MAX instead of isize::MAX
isize::MAX not working on Rust 1.42.0
2020-12-17 10:09:18 +09:00
Kogia-sima a5f40fe270 Revert "refactor: Use nanorand crate instead of custom xorshift implementation"
This reverts commit d0ec00fb29.
I found that nanorand crate does not work on Mac OSX.
2020-12-17 10:07:53 +09:00
Kogia-sima 1107757ad1 Add test for Techempower Framework Benchmarks
cc #37
2020-12-17 10:02:49 +09:00
Kogia-sima 8179de521d docs: Revert documents
v0.2.3 still requires `extern crate sailfish_macros;`
2020-12-17 00:04:47 +09:00
Kogia-sima ac728a8495 Update AFL tests 2020-12-16 23:15:22 +09:00
Kogia-sima c182e41622 perf: Optimize Buffer::push()
fix #8
2020-12-16 21:52:39 +09:00
Kogia-sima aa0afb1f81 doc: Update safety documents
and some assertion fix
2020-12-16 21:17:06 +09:00
Kogia-sima 1ec10031f5 refactor: Turn off unused features in dependencies 2020-12-16 20:14:38 +09:00
Kogia-sima a1abc2aaa3 refactor: Simplify derive option parsing 2020-12-16 19:55:28 +09:00
Kogia-sima 98edecdb3a refactor: suppress use of to_string_lossy 2020-12-16 19:13:37 +09:00
Kogia-sima 6c7a74823f refactor: use DefaultHasher instead of custom fnv hash implementation 2020-12-16 19:01:28 +09:00
Kogia-sima 790f7366cf break: Update TemplateOnce trait structure
* Remove render_once_to_string method
* Add render_once_to method
* Now TemplateOnce trait requires both method implementation
* Some performance improvement
2020-12-16 19:01:28 +09:00
Kogia-sima d0ec00fb29 refactor: Use nanorand crate instead of custom xorshift implementation 2020-12-16 16:52:07 +09:00
Kogia-sima 9b733f973f suppress dead_code warning when target_feature = "avx2" 2020-12-16 15:44:20 +09:00
Kogia-sima a965f03321 Update error format 2020-12-16 15:38:28 +09:00
Kogia-sima 99e0f4cf89 Merge branch 'perf/reserve_small' 2020-12-16 15:23:56 +09:00
Kogia-sima fcf3bc1be4 Revert "Remove benchmarks"
This reverts commit 7726b4c063.
2020-12-16 15:20:10 +09:00
Kogia-sima c7093a727a perf: Replace reserve with reserve_small 2020-12-16 15:18:04 +09:00
Kogia-sima 7726b4c063 Remove benchmarks 2020-12-16 13:38:17 +09:00
Kogia-sima 2d6d913213 no longer requires `extern crate sailfish_macros` 2020-12-16 13:35:37 +09:00
Kogia-sima 72b061ee3e refactor: Use unlikely in Buffer::reserve() 2020-11-30 12:19:03 +09:00
Kogia-sima 8e513bb6fd Merge branch 'master' into stable 2020-11-29 21:41:36 +09:00
Kogia-sima 541ecb91ef Bump version (0.2.2 => 0.2.3) 2020-11-29 21:40:58 +09:00
Kogia-sima 4d993256fe Add `derive` feature for sailfish crate 2020-11-29 21:39:50 +09:00
Kogia-sima db7aaf5edc Add forbid(unsafe_code) in sailfish-compiler/macros 2020-11-29 21:22:31 +09:00
Kogia-sima 4e949848d0
Merge pull request #34 from Svenskunganka/master
Use std::result::Result in derive macro to allow custom Result types
2020-11-22 11:33:53 +09:00
Kogia-sima c9b4d08ed0 refactor: hide Buffer::clear() method
This method is dangerous because it might deletes all contents
previouslly rendered.
2020-11-21 18:44:56 +09:00
Kogia-sima 834289be59 refactor: Reduce unsafe blocks 2020-11-21 18:44:52 +09:00
Kogia-sima 82fb9f5469 refactor: Remove unused code 2020-11-21 18:25:36 +09:00
Kogia-sima ed25390917 Avoid running compile-failure tests in CI 2020-11-21 18:03:45 +09:00
Kogia-sima 52e635af6e Update compile error tests 2020-11-21 18:03:41 +09:00
Tom Jordell 9d405ad9ff Use std::result::Result in derive macro to allow custom Result types 2020-11-21 08:40:46 +01:00
Kogia-sima 4ea8661415 Merge branch 'master' into stable 2020-11-11 10:48:58 +09:00
Kogia-sima cfd40f573b Bump version (0.2.1 => v0.2.2) 2020-11-11 10:48:30 +09:00
Kogia-sima af6c052b1f Update proc-macro2 (fix #32) 2020-11-11 10:46:40 +09:00
Kogia-sima 2ecc5ce63f Update CHANGELOG 2020-08-04 09:28:28 +09:00
Kogia-sima c50a87cf79 Merge branch 'master' into stable 2020-08-04 09:18:49 +09:00
Kogia-sima 2ba4a99582 Bump version (0.2.0 => 0.2.1) 2020-08-04 09:18:24 +09:00
Kogia-sima 5666f92b9d Search rustfmt along all toolchains 2020-08-04 03:33:49 +09:00
Kogia-sima d79a5d3b4b perf: Zero-copy conversion from String into Buffer 2020-08-04 03:14:21 +09:00
Kogia-sima 941cd965ab Do not use render_once_to_string method directly 2020-07-26 00:02:51 +09:00
Kogia-sima 4f64a3b7fe Avoid over-size allocation in `render_once_to_string` 2020-07-25 23:56:17 +09:00
Kogia-sima 658a623008 Remove profile overrides 2020-07-25 07:58:13 +09:00
Kogia-sima 4fc278ecfb Revert "Improve Template::render() performance"
This reverts commit 4e8b437387.
2020-07-25 07:48:00 +09:00
Kogia-sima 383a6db3e3 Add `rm_whitespace = true` option for some tests 2020-07-25 07:48:00 +09:00
Kogia-sima 3678978e54
Merge pull request #30 from stoically/patch-1
Fix docs typo
2020-07-24 12:35:30 +09:00
stoically f37f074a67
Fix docs typo 2020-07-24 04:32:51 +02:00
Kogia-sima 4a8ce80e3d improve escape_small() performance 2020-07-23 11:49:53 +09:00
Kogia-sima 4e8b437387 Improve Template::render() performance 2020-07-23 11:48:19 +09:00
Kogia-sima cc10171b73 Avoid dangerous conversion from String to Buffer 2020-07-22 07:05:15 +09:00
Kogia-sima fcde448751 Add trim filter 2020-07-22 06:40:26 +09:00
Kogia-sima 31bbcaebc8 Avoid capacity overflow in Buffer::with_capacity 2020-07-22 03:25:07 +09:00
Kogia-sima 236dff6b10 Improve size hint update algorithm 2020-07-21 09:00:15 +09:00
Kogia-sima 9765de213f Allow proc-macro2 v1.0.19 as a dependency 2020-07-21 07:22:34 +09:00
Kogia-sima a3fdc8e226 fix: Fix vim syntax highlighting
* highlight sailfish tag inside html strings
2020-07-18 09:31:23 +09:00
Kogia-sima 3515380d93 Add CHANGELOG.md 2020-07-18 02:34:22 +09:00
Kogia-sima 9dfcfe2c45 Add filter documentation in User Guide 2020-07-17 18:06:06 +09:00
Kogia-sima c809027152 Merge branch 'master' into stable 2020-07-17 04:48:56 +09:00
Kogia-sima d0ef795161 Bump version (0.1.3 => 0.2.0) 2020-07-17 04:48:29 +09:00
Kogia-sima 1141580878 Fix number of skips on parsing code block 2020-07-15 23:22:10 +09:00
Kogia-sima 80b64fe883 break: Remove Buffer::set_len method
This method allows reducing the buffer size, but it should not be
possible.
Alternatively I added a Buffer::advance method to increase the length.
2020-07-15 19:49:35 +09:00
Kogia-sima fabc3ba149 Merge branch 'feature/filter'
close #2
2020-07-15 19:40:53 +09:00
Kogia-sima 15b0504564 Add tests for filter 2020-07-15 19:34:53 +09:00
Kogia-sima eac0dfbf5b Add minimal runtime filters 2020-07-15 17:12:31 +09:00
Kogia-sima 373ffc135e Implement filter transformation 2020-07-15 07:38:11 +09:00
Kogia-sima 2d15165406 break: Syntactically disallow invalid filter expression 2020-07-15 04:17:50 +09:00
Kogia-sima 119e282945 Avoid generating _size_hint local variable 2020-07-15 00:06:01 +09:00
Kogia-sima 670d936def break: remove runtime::Context API 2020-07-15 00:06:01 +09:00