Skip to content

Commit

Permalink
Release v0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
KaruroChori committed Jan 20, 2025
1 parent f677264 commit 06c6f3b
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 14 deletions.
20 changes: 20 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
## v0.4.1

This first revision of the new minor has no real incompatibility with the previous one, just some fixes and small new features.

## New features

As expected, this update and the next few ones will be light on new features, mostly focusing on documentation, fixes and architectural improvements.
Still, using the library for its intended purpose exposed some sharp edges, which will be/have been taken care of.
This is what is new in this release:

- Centralize `symbol` comparisons have been extended and centralized in a single function serving the entire code base.
- Strings will now support ordering based on the dot modifier even when `random` is used.
- There is default support for string comparisons in the boolean operators of the RPN. Several fixes have been resolved for the other comparisons as well.
- A new prop command `s:enable.*`. It conditionally adds a prop if the condition is true.
This might be reworked in `s:when.*` as this override does not conflict with the other `s:when`, but no decision has been taken yet.

## Fixes

- Several conversions are now locale-independent.
- In the UI for the demo, the generate button is now locked while fetching examples.
- Many fixes in the docs and demo examples.
9 changes: 0 additions & 9 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
# Milestones

## `v0.4.1`

- [x] In the UI for the demo, lock button to generate while fetching examples
- [x] Rework the mechanisms used in `order-by` and fill missing comparisons in the RPN
- [x] Centralize `symbol` comparisons in a single function
- [x] Strings in dot notation when ordering by random should apply hashing and comparison to each block sequentially.
- [x] String support in RPN (only default criterion for now)
- [x] `s:enable` as prop command

## `v0.4.2`

- [ ] Rework the mechanisms used in `order-by` and fill missing comparisons in the RPN
Expand Down
19 changes: 19 additions & 0 deletions docs/releases/v0.4.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
This first revision of the new minor has no real incompatibility with the previous one, just some fixes and small new features.

## New features

As expected, this update and the next few ones will be light on new features, mostly focusing on documentation, fixes and architectural improvements.
Still, using the library for its intended purpose exposed some sharp edges, which will be/have been taken care of.
This is what is new in this release:

- Centralize `symbol` comparisons have been extended and centralized in a single function serving the entire code base.
- Strings will now support ordering based on the dot modifier even when `random` is used.
- There is default support for string comparisons in the boolean operators of the RPN. Several fixes have been resolved for the other comparisons as well.
- A new prop command `s:enable.*`. It conditionally adds a prop if the condition is true.
This might be reworked in `s:when.*` as this override does not conflict with the other `s:when`, but no decision has been taken yet.

## Fixes

- Several conversions are now locale-independent.
- In the UI for the demo, the generate button is now locked while fetching examples.
- Many fixes in the docs and demo examples.
6 changes: 3 additions & 3 deletions src/stack-lang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ std::optional<symbol> repl::eval(const char* expr) noexcept{
stack.pop();
if(std::holds_alternative<int>(t))stack.push(std::get<int>(t));
else if(std::holds_alternative<float>(t))stack.push((int)std::get<float>(t));
else if(std::holds_alternative<std::string>(t)){auto& str = std::get<std::string>(t);int result{};std::from_chars(str.c_str(),str.c_str()+str.size(),result);stack.push(result);}
else if(std::holds_alternative<std::string>(t)){auto& str = std::get<std::string>(t);int result{};std::from_chars(str.c_str(),str.c_str()+str.size(),result,10);stack.push(result);}
else return error_t::WRONG_TYPE;
return error_t::OK;
}, 1}},
Expand All @@ -226,7 +226,7 @@ std::optional<symbol> repl::eval(const char* expr) noexcept{
stack.pop();
if(std::holds_alternative<int>(t))stack.push((float)std::get<int>(t));
else if(std::holds_alternative<float>(t))stack.push(std::get<float>(t));
else if(std::holds_alternative<std::string>(t)){auto& str = std::get<std::string>(t);float result{};std::from_chars(str.c_str(),str.c_str()+str.size(),result);stack.push(result);}
else if(std::holds_alternative<std::string>(t)){auto& str = std::get<std::string>(t);double result{};std::from_chars(str.c_str(),str.c_str()+str.size(),result);stack.push((float)result);}
else return error_t::WRONG_TYPE;
return error_t::OK;
}, 1}},
Expand Down Expand Up @@ -296,7 +296,7 @@ std::optional<symbol> repl::eval(const char* expr) noexcept{
if(expr[i]==':'){
if(expr[i+1]=='*'){arity = stack.size();}
else{
std::from_chars(expr+i+1, expr+current+end, arity);
std::from_chars(expr+i+1, expr+current+end, arity,10);
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/vs-templ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <string_view>
#include <variant>
#include <format>
#include <charconv>

#include "vs-templ.hpp"
#include "stack-lang.hpp"
Expand Down Expand Up @@ -132,8 +133,8 @@ std::optional<symbol> preprocessor::resolve_expr(const std::string_view& _str, c

int idx = 0;
if(str[0]=='.' || str[0]=='+' || str[0]=='-' || (str[0]>'0' && str[0]<'9')){
if(_str[_str.length()-1]=='f'){str[_str.length()-1]=0;float result{};std::from_chars(str,str+_str.length()-1,result);return result;}
else{int result{};std::from_chars(str,str+_str.length(),result);return result;}
if(_str[_str.length()-1]=='f'){str[_str.length()-1]=0;double result{};std::from_chars(str,str+_str.length()-1,result);return (float)result;}
else{int result{};std::from_chars(str,str+_str.length(),result,10);return result;}
}
else if(str[0]==':') {
repl r(*this);
Expand Down

0 comments on commit 06c6f3b

Please sign in to comment.