forked from cobalt-org/liquid-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(value): Improve value coercion practices
Template impact: There is now a consistent approach taken to when a `Value` can be used as a string, whole number, fractional number, bool etc. Examples - Every `Value` is now treated as a string. - Whole numbers are now preserved. - Whole numbers can convert to fractional numbers but not the other way around. - You can convert a fractional number to a whole number using the filters `round`, `ceil`, or `floor`. - Operations on only whole numbers preserve their whole number nature. - for tag ranges, indexing, etc only accept whole numbers Fixes cobalt-org#99 Programmatic impact: This implements the `Value` refactor from cobalt-org#95. `Value` is still an enum but now there is a single `Scalar` variant. This scalar is not an enum but is convertible between each of the common data types. Optimizations are in place to natively store some of these data types. BREAKING CHANGE: `Value`'s API has changed. Conversion behavior within templates has changed.
- Loading branch information
Showing
23 changed files
with
1,218 additions
and
828 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.