Commit Graph

126 Commits

Author SHA1 Message Date
Michael Pfaff 19559e5c09 Allow any ASCII whitespace instead of just space after `<%` 2024-03-15 18:47:29 -04:00
Michael Pfaff 6e09ca7464 Refactor to support custom escaping schemes 2024-03-15 18:05:31 -04:00
Michael Pfaff 2db5b83461 Improve comment syntax 2024-03-11 22:42:08 -04:00
Michael Pfaff 878a026851 Ignore escaping on derived templates 2024-03-11 18:43:13 -04:00
Michael Pfaff 4e2232f2de Unify Render* and Template* traits 2024-03-11 17:33:11 -04:00
Michael Pfaff e5a471d9ca Improve API 2024-03-11 16:57:52 -04:00
vthg2themax 2e39299483 bump version in preparation for upload to crates.io 2023-10-22 05:01:13 -04:00
Vince Pike ef79697c6e
Merge pull request #138 from levkk/levkk-fix-filename-conflict
Fix filename conflict
2023-10-22 04:54:44 -04:00
Lev af91dc5243 remove space 2023-10-21 14:10:31 -07:00
Lev 4c554d1a57 Fix filename conflict 2023-10-21 14:09:00 -07:00
Miran Bastaja 28972209cd
dep: update toml to 0.8.2 2023-10-17 16:55:47 +02:00
vthg2themax 222f69c38a Update Version Number For Latest Release 2023-10-09 15:22:18 -04:00
Newton Ni 01ba06707b Use timestamps for change detection
This commit changes the caching mechanism to use the timestamp of
all included templates instead of hashing the contents of the
root template.

The primary downside is that every build now has to parse, transform,
and resolve the input templates instead of just reading and hashing
the data--I didn't measure how much more expensive this is, but it
seems unavoidable if we need information about child templates.
Maybe a hacky regex-based approach could work as an alternative to
a complete parse.

On the bright side, this approach rebuilds parent templates correctly
when a child template has changed, and doesn't require garbage collection
for old compiled template files.
2023-10-02 13:21:29 -05:00
vthg2themax c05154271a Update config.rs and procmacro.rs 2023-07-28 10:28:02 -04:00
vthg2themax 9d9351b670 Update Version Numbers Now 2023-07-28 10:20:51 -04:00
vthg2themax 0a5f6c6b5c Update Cargo.lock, README.md, installation.md, and 7 more files Update the version, and publish. 2023-06-22 15:11:54 -04:00
vthg2themax 9b0cd6263c Update Version 2023-04-13 14:09:37 -04:00
liushuyu 2a8e1a7b7d
dep: update syn to v2 (#115)
* dep: update syn to v2

* fix a broken test.

---------

Co-authored-by: Vince Pike <25014503+vthg2themax@users.noreply.github.com>
2023-04-12 10:02:05 -04:00
Kogia-sima fd4f43b91b dep: Update toml crate (0.5 => 0.7) 2023-03-05 20:19:17 +09:00
Kogia-sima 5fe0934aba Add comment about `include_bytes_seq`
`include_bytes_seq` statements are required for cargo to watch child
templates. Without them, compiler won't re-run after the child templates
are updated.

cc #112
2023-03-05 18:08:56 +09:00
Vince Pike b293756277
Update The Version In Preparation For Release (#109)
Co-authored-by: Vince Pike <vince@oryp9>
2023-01-24 16:43:15 -05:00
Daniel Arbuckle 96d4ad3e01 switched introductory symbol to + 2023-01-24 07:58:40 -08:00
Daniel Arbuckle c282daf907 Shorthand syntax for rendering a TemplateOnce within another template 2023-01-19 03:07:43 -08:00
Kogia-sima 658e55d1cc Bump version (0.4.0 => 0.5.0) 2022-10-25 22:44:36 +09:00
Kogia-sima f802e376ab Fix proc-macro2 version conflict 2022-10-25 22:41:00 +09:00
Kogia-sima 931233570c dep: Update proc-macro2 (1.0.36 => 1.0.43) 2022-08-14 15:18:13 +09:00
Vince Pike 9955a3acf0 Switch to TOML Format 2022-03-10 15:20:47 -05:00
Vince Pike ef48042264
Merge pull request #57 from Svenskunganka/toml
Change config file format from YAML to TOML
2022-03-09 11:01:11 -05:00
Kogia-sima 7ff3979888 Update repository URL 2022-02-19 14:47:00 +09:00
Kogia-sima bffe6d1aa1 Bump version (0.3.3 => 0.3.4) 2022-02-13 10:15:34 +09:00
Kogia-sima e8dc2b5773 Bump dependency versions 2022-02-13 10:15:18 +09:00
Tom 6172cd0dcc Change config file format from YAML to TOML and add support for embedding environment variables in the config file 2021-05-01 06:39:38 +02:00
Kogia-sima 8fc70c39fa Bump version (0.3.2 => 0.3.3) 2021-04-06 21:52:20 +09:00
Kogia-sima 9bf4090468 Better error reporting for missing semicolon in code clock
cc #33 #53
2021-04-06 21:50:20 +09:00
Kogia-sima 62b13b1b8d Fix package description 2021-04-06 20:46:46 +09:00
Kogia-sima 7c555d6905 Bump proc-macro2 (1.0.24 => 1.0.26) 2021-04-06 20:42:35 +09:00
Kogia-sima 2df4bd1d2d Bump version (0.3.1 => 0.3.2) 2021-03-29 08:47:01 +09:00
Kogia-sima 2aa09d127d Update pretty_assertions 2021-03-29 08:46:49 +09:00
Kogia-sima c9e6449292 Add analyzer.rs
cc #53
2021-02-04 03:11:17 +09:00
Kogia-sima 10ab29be85 Prefer using scope guard for `fallback::unforce()`
This scope guard ensure that `fallback::unforce()` will be called even
if the program panics during compilation.
2021-02-03 15:52:14 +09:00
Kogia-sima 5e12280df1 Fix stable/nightly mismatch error cause by proc-macro2
fix #50
2021-02-03 02:56:15 +09:00
Kogia-sima 5209876df4 Bump version (0.3.0 => 0.3.1) 2021-01-23 19:27:25 +09:00
Kogia-sima 7bab7ac0a5 fix: Workaround for incorrect cargo fingerprints
Note: This is a silly hack to prevent temporary artifacts to be tracked
by cargo. This behaviour depends on cargo's internal implementation, and
thus this workaround may suddenly stop working in the future. Another
better option should be considered.
2021-01-23 19:09:54 +09:00
Kogia-sima e69d36b168 refactor: clippy fix 2020-12-29 16:53:46 +09:00
Kogia-sima d07afad79b test: temporarily disable translator test
Currently the translator test cause unexpected error with "-Zprofile"
flag for unknown reason.
2020-12-29 03:24:59 +09:00
Kogia-sima 92c8f8a852 refactor: remove unused code 2020-12-24 17:41:51 +09:00
Kogia-sima 348a3825f2 perf: join after loop-optimization 2020-12-24 17:22:11 +09:00
Kogia-sima 1df0657350 Bump version (0.2.3 => 0.3.0) 2020-12-20 22:16:25 +09:00
Kogia-sima 28b5c6abd1 Generate more readable code 2020-12-19 20:51:01 +09:00
Kogia-sima 70033d604d break: forbit implementing TemplateOnce trait by hand 2020-12-19 17:38:57 +09:00
Kogia-sima 15f397348a refactor: Organize source code for readability 2020-12-18 23:00:40 +09:00
Kogia-sima f98ed7426f clippy fix 2020-12-18 19:23:20 +09:00
Kogia-sima 47c09e4f55 refactor: Remove dbg!() 2020-12-18 11:03:44 +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 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 a965f03321 Update error format 2020-12-16 15:38:28 +09:00
Kogia-sima 541ecb91ef Bump version (0.2.2 => 0.2.3) 2020-11-29 21:40:58 +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 834289be59 refactor: Reduce unsafe blocks 2020-11-21 18:44:52 +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 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 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 4f64a3b7fe Avoid over-size allocation in `render_once_to_string` 2020-07-25 23:56:17 +09:00
Kogia-sima 4fc278ecfb Revert "Improve Template::render() performance"
This reverts commit 4e8b437387.
2020-07-25 07:48:00 +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 9765de213f Allow proc-macro2 v1.0.19 as a dependency 2020-07-21 07:22:34 +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 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
Kogia-sima 869c58dcb1 Use UFCS instead of receiver coecions
This change is required to achieve filter
2020-07-15 00:06:01 +09:00
Kogia-sima 3040084ca9 do not use `sfrt` as an alias to sailfish::runtime 2020-07-15 00:05:56 +09:00
Kogia-sima 6c72bb17d1 Put all tests in sailfish-tests/ directory 2020-07-14 22:46:58 +09:00
Kogia-sima b420cc0161 feat: Implement Compiler::compile_str() function 2020-07-14 22:07:35 +09:00
Kogia-sima 65636d2ebc Suppress "Failed to remote artifact" error in rust-analyzer 2020-07-13 01:28:42 +09:00
Kogia-sima 3b06795f5e Bump version (0.1.2 => 0.1.3) 2020-07-11 17:46:55 +09:00
Kogia-sima 9982ab0683 Suppress warning when `config` feature flag is disabled 2020-07-11 17:02:31 +09:00
Kogia-sima e8beaef33b Bump version (0.1.1 => 0.1.2) 2020-07-04 06:17:09 +09:00
Kogia-sima f40926122b feat: Add TemplateOnce::render_once_to_string method 2020-06-18 18:37:39 +09:00
Kogia-sima b5d035493f Bump version (0.1.0 => 0.1.1) 2020-06-18 18:04:02 +09:00
Kogia-sima f2d5eb2b73 Bump version (0.0.5 => 0.1.0) 2020-06-15 12:17:19 +09:00
Kogia-sima d1b6d2559a feat: New feature flag (config) 2020-06-15 06:44:49 +09:00
Kogia-sima 2d994be4ff feat: Global configuration file 2020-06-15 05:36:39 +09:00
Kogia-sima 5b4c13af3e dep: Add dependency (yaml-rust) 2020-06-14 22:07:28 +09:00
Kogia-sima 25364a6bcc Enhanced error message 2020-06-14 17:30:36 +09:00
Kogia-sima 733e1a6c63 Bump version (0.0.4 => 0.0.5) 2020-06-13 23:18:07 +09:00
Kogia-sima 98e11b1163 fix: Re-compile when child template is update. 2020-06-13 22:58:57 +09:00
Kogia-sima 8a83c2e278 Avoid method name collision in render* macros
fix #9
2020-06-13 13:16:39 +09:00
Kogia-sima 6ac39eee4c refactor: refactor resolver code 2020-06-11 21:35:14 +09:00