Commit Graph

511 Commits

Author SHA1 Message Date
Kogia-sima 8864d0258c Add tests for method name collision
cc #9
2020-06-13 23:04:14 +09:00
Kogia-sima 98e11b1163 fix: Re-compile when child template is update. 2020-06-13 22:58:57 +09:00
Kogia-sima 9949c91f7d Fix std::write benchmark 2020-06-13 14:24:36 +09:00
Kogia-sima 8a83c2e278 Avoid method name collision in render* macros
fix #9
2020-06-13 13:16:39 +09:00
Juan Aguilar Santillana 86658d4a96 Fix yarte fixed bench 2020-06-12 08:20:45 +00:00
Kogia-sima dad577db8b Avoid empty buffer allocation
cc #10
2020-06-12 15:03:57 +09:00
Kogia-sima db41ab3cb1 Use `capacity == 0` instead of `ptr::is_null`
This change allows more fast conversion between String
2020-06-12 14:56:49 +09:00
Kogia-sima 1fa5186e34 Manually implement Clone and Debug for Buffer
fix #10
2020-06-12 14:56:36 +09:00
Kogia-sima 6ac39eee4c refactor: refactor resolver code 2020-06-11 21:35:14 +09:00
Kogia-sima ab4b0c99e6 Move include_rust test into unix module
This test fails on Windows because arguments in include! macro is
regarded as native path. This follows the std::include! macro behaviour.
2020-06-11 19:49:35 +09:00
Kogia-sima d7a2ff8008 Fix include! implementation for Rust file
Also add tests for including Rust file
2020-06-11 19:43:01 +09:00
Kogia-sima d302f30144 Format code 2020-06-11 19:42:22 +09:00
Kogia-sima dc4d062b8d Test for Error::kind() 2020-06-11 19:22:19 +09:00
Kogia-sima 0612a28c50 Add rust_macro test 2020-06-11 19:18:51 +09:00
Kogia-sima 6dea4793ab Add some tests for runtime 2020-06-11 19:02:28 +09:00
Kogia-sima d7c3b8fa0b Add some compile error test 2020-06-11 16:01:30 +09:00
Kogia-sima 7665690982 Change input/output directory for integration-tests 2020-06-11 15:31:55 +09:00
Kogia-sima 7cc4692951 Bump version (0.0.3 => 0.0.4) 2020-06-11 11:55:51 +09:00
Kogia-sima 1539f23a35 Remove dependency (itoa) 2020-06-11 11:53:45 +09:00
Kogia-sima 9cfb4d5d85 Reduce output binary size without performance degration
- Remove #[inline] from sailfish::runtime::integer::write_* functions
- Add #[inline(never)] for sailfish::runtime::Buffer::reserve
2020-06-11 11:41:48 +09:00
Kogia-sima 012ee9d993 Speed up HTML escaping when target feature was specified 2020-06-10 23:30:11 +09:00
Kogia-sima 86e8313db4 Add missing `#[cfg(test)]` 2020-06-10 19:27:05 +09:00
Kogia-sima 93672551d8 Update benchmark environment 2020-06-10 19:21:43 +09:00
Kogia-sima a33b8ad1f4 Speedup appveyor build 2020-06-10 19:15:39 +09:00
Kogia-sima 02380994dd Update benchmark result
[skip ci]
2020-06-10 19:14:33 +09:00
Kogia-sima 21064b2662 Merge branch 'perf/fastint' 2020-06-10 18:44:10 +09:00
Kogia-sima c5a311e8c6 Use integer module to render integer 2020-06-10 18:41:12 +09:00
Kogia-sima c5015be783 Add new module (sailfish::runtime::integer) 2020-06-10 18:33:31 +09:00
Kogia-sima aea4e02259 Optimize escape function for small strings 2020-06-10 10:56:25 +09:00
Kogia-sima 53f0db024c Speed up feature detection for escaping
- Remove sailfish::runtime::escape::escape_with
2020-06-10 10:27:13 +09:00
Kogia-sima 655bcb9e2f Add .gitattributes 2020-06-10 00:00:20 +09:00
Kogia-sima 95e707152a Return Result<(), RenderError> in `Render` trait methods 2020-06-09 22:49:44 +09:00
Kogia-sima cd1b286f1b Rename some Buffer's methods
- Buffer::write_str => Buffer::push_str
- Buffer::write_char => Buffer::push
2020-06-09 22:38:24 +09:00
Kogia-sima 34d51dd6ea Merge branch 'doc/website' 2020-06-09 21:50:30 +09:00
Kogia-sima 094d76744a Add links to documentation in README
[skip ci]
2020-06-09 21:50:03 +09:00
Kogia-sima 7c3705d624 Remove some badges from README
[skip ci]
2020-06-09 21:49:54 +09:00
Kogia-sima 4344a1b0a2 Add build script 2020-06-09 21:37:07 +09:00
Kogia-sima 1512cfad04 Update Python version 2020-06-09 21:34:46 +09:00
Kogia-sima 09685646ae Add documentation sources 2020-06-09 21:19:59 +09:00
Kogia-sima c86effe90f Remove unused function 2020-06-08 22:34:59 +09:00
Kogia-sima 7848f34e37 impl Render for bool 2020-06-08 20:24:28 +09:00
Kogia-sima 28116fc125 Paste benchmark results collected on Cloud 2020-06-08 16:39:28 +09:00
Kogia-sima bbb524952a
Use ERB for syntax highlighting in README
[skip ci]
2020-06-08 13:14:09 +09:00
Kogia-sima 0162e44ff8 Remove unused code 2020-06-07 23:23:45 +09:00
Kogia-sima eeeb47ed84 Remove #[allow(dead_code)] for function 2020-06-07 23:20:36 +09:00
Kogia-sima d3320d41f0 Add test for nested comment block 2020-06-07 23:19:27 +09:00
Kogia-sima 3f727b0451 Add receiver coercion test 2020-06-07 23:14:54 +09:00
Kogia-sima c5fc4a64a6 Use `escape_to_string` in tests 2020-06-07 23:01:24 +09:00
Kogia-sima 63186cb15f Add test for fallback HTML escaping implementation 2020-06-07 22:57:43 +09:00
Kogia-sima f103f6e4ba Fix fallback implementation for HTML escaping 2020-06-07 22:57:21 +09:00
Kogia-sima 09ded92800 Merge branch 'feature/coverage'
[skip appveyor]
2020-06-07 22:30:19 +09:00
Kogia-sima c537cdba3b Add codecov badge 2020-06-07 22:29:49 +09:00
Kogia-sima 5416f8ca14 Fix error caused by -Cpanic=abort option
[skip appveyor]
2020-06-07 22:21:33 +09:00
Kogia-sima d43e4c0551 Add script to collect coverage on Travis CI 2020-06-07 22:14:32 +09:00
Kogia-sima 17594088ae Rename test file (basic.rs => template_once.rs)
[skip ci]
2020-06-07 21:48:52 +09:00
Kogia-sima c601be94c1 Add some compile failure tests 2020-06-07 21:38:49 +09:00
Kogia-sima e19ef51f39 Suppress unused import warning 2020-06-07 21:12:02 +09:00
Kogia-sima 5c7065a411 Use proc_macro2::fallback::force() API
This api forces the use of proc-macro2's fallback implementation. This
allows to keep span information during parsing.
2020-06-07 20:52:38 +09:00
Kogia-sima 2e1b9b2c87 Specify proc-macro2 version
This specification is required to use `fallback::force()` API.
2020-06-07 20:42:55 +09:00
Kogia-sima 40ca8ef5f0 Remove unstability warning from README
[skip ci]
2020-06-07 19:58:56 +09:00
Kogia-sima 69d7d6c39c Bump version (0.0.2 => 0.0.3) 2020-06-07 19:14:23 +09:00
Kogia-sima e12e42e15a Remove `impl<T: Display> Render for &T`
This specialization should be discussed more deeply. This specialization
is very useful when you want to render the non-specialized types such as
url::Url. However, when you write a reference type inside templates,
that fallbacks to non-specialized call, which is slower than specialized
call.
2020-06-07 18:57:51 +09:00
Kogia-sima fd3d224067 Refactor source code with rustfmt and clippy
[skip ci]
2020-06-07 17:58:52 +09:00
Kogia-sima 06c2d10255 Update README 2020-06-07 13:41:08 +09:00
Kogia-sima 37c4e4d11d Merge branch 'feature/rm-whitespace' 2020-06-07 13:14:11 +09:00
Kogia-sima d9a4d8f019 Update benchmark result 2020-06-07 13:13:48 +09:00
Kogia-sima 908b20f5e7 Use `rm_whitespace` in benchmark 2020-06-07 13:10:40 +09:00
Kogia-sima 7324165ab0 Add test for rm_whitespace option 2020-06-07 13:00:28 +09:00
Kogia-sima 61ff466976 Add `rm_whitespace` option 2020-06-07 13:00:28 +09:00
Kogia-sima 9c4b6352d5 Add rm_whitespace option 2020-06-07 13:00:28 +09:00
Kogia-sima 737733ee47 Merge branch 'perf/raw-buffer' 2020-06-07 12:58:02 +09:00
Kogia-sima 09646cd685 Add test for string conversion 2020-06-07 12:57:15 +09:00
Kogia-sima 3114cb37e2 Re-implement Buffer with raw memory operations 2020-06-07 12:48:18 +09:00
Kogia-sima 0a597796bd Update benchmark result
[skip ci]
2020-06-07 11:49:19 +09:00
Kogia-sima 94e7ce2e8a TODO comments
[skip ci]
2020-06-07 11:49:15 +09:00
Kogia-sima 0f0529684a Add appveyor badge
[skip ci]
2020-06-07 05:48:43 +09:00
Kogia-sima 04b5b09207 Ignore include-nest tests on Windows
On Windows the main separator for paths is '\\', and include! macro
should be regarded as platform-specific path. In the future sailfish
add the corresponding tests for Windows.
2020-06-07 05:43:17 +09:00
Kogia-sima f0cd89a949 Add actix-web example
[skip ci]
2020-06-07 05:36:21 +09:00
Kogia-sima 3a9260f2a7 Add appveyor.yml
[skip travis]
2020-06-07 05:04:21 +09:00
Kogia-sima 82f7b7a64a Add Travis CI badge
[skip ci]
2020-06-07 05:01:58 +09:00
Kogia-sima c3e1eb45ce Add .travis.yml 2020-06-07 04:57:00 +09:00
Kogia-sima de2b164aa0 Integration tests for benchmark code 2020-06-07 04:55:22 +09:00
Kogia-sima f3c9a21140 Resolve include! for Rust file correctly 2020-06-07 04:53:49 +09:00
Kogia-sima 6f721790b5 Add integration-tests/README.md 2020-06-07 04:07:42 +09:00
Kogia-sima b24861e158 Skip attribute if it is not wrapped with `template` 2020-06-07 03:44:30 +09:00
Kogia-sima 5b6b48f204 Update include-nest test for 76abe1c 2020-06-07 03:23:34 +09:00
Kogia-sima 76abe1c0ac Pop include path stack 2020-06-07 03:21:17 +09:00
Kogia-sima e7c0992568 Export compiler config struct 2020-06-07 03:20:01 +09:00
Kogia-sima 307f44d910 Add docs.rs badge 2020-06-07 01:34:36 +09:00
Kogia-sima d3ee38c6f2 Update test for commit 6d07c43 2020-06-07 01:28:17 +09:00
Kogia-sima 6d07c43876 Strip the brake line at end of file 2020-06-07 01:25:52 +09:00
Kogia-sima f116941904 Merge branch 'feature/include' 2020-06-07 00:56:05 +09:00
Kogia-sima 8e5b76f2ab Ignore include! for rust file 2020-06-07 00:52:53 +09:00
Kogia-sima 4b1fd92488 Add 'include-nest' test 2020-06-07 00:49:50 +09:00
Kogia-sima 7d77b755c6 Resolve child template path inside resolver 2020-06-07 00:43:10 +09:00
Kogia-sima 64ded9616a resolve to relative path in include! by default 2020-06-06 23:43:41 +09:00
Kogia-sima cd8e3d832a Add integration test for include! 2020-06-06 23:21:38 +09:00
Kogia-sima c618f19cb6 Add example using include! macro 2020-06-06 22:49:27 +09:00
Kogia-sima 12174ff5c5 Implement include! macro 2020-06-06 22:49:01 +09:00
Kogia-sima 188e90cfc3 Merge branch 'docs/minimal' 2020-06-06 19:27:07 +09:00