Skip to content

Commit 06c6f3b

Browse files
committed
Release v0.4.1
1 parent f677264 commit 06c6f3b

File tree

5 files changed

+45
-14
lines changed

5 files changed

+45
-14
lines changed

RELEASE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
11
## v0.4.1
2+
3+
This first revision of the new minor has no real incompatibility with the previous one, just some fixes and small new features.
4+
5+
## New features
6+
7+
As expected, this update and the next few ones will be light on new features, mostly focusing on documentation, fixes and architectural improvements.
8+
Still, using the library for its intended purpose exposed some sharp edges, which will be/have been taken care of.
9+
This is what is new in this release:
10+
11+
- Centralize `symbol` comparisons have been extended and centralized in a single function serving the entire code base.
12+
- Strings will now support ordering based on the dot modifier even when `random` is used.
13+
- 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.
14+
- A new prop command `s:enable.*`. It conditionally adds a prop if the condition is true.
15+
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.
16+
17+
## Fixes
18+
19+
- Several conversions are now locale-independent.
20+
- In the UI for the demo, the generate button is now locked while fetching examples.
21+
- Many fixes in the docs and demo examples.

TODO.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
# Milestones
22

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

145
- [ ] Rework the mechanisms used in `order-by` and fill missing comparisons in the RPN

docs/releases/v0.4.1.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
This first revision of the new minor has no real incompatibility with the previous one, just some fixes and small new features.
2+
3+
## New features
4+
5+
As expected, this update and the next few ones will be light on new features, mostly focusing on documentation, fixes and architectural improvements.
6+
Still, using the library for its intended purpose exposed some sharp edges, which will be/have been taken care of.
7+
This is what is new in this release:
8+
9+
- Centralize `symbol` comparisons have been extended and centralized in a single function serving the entire code base.
10+
- Strings will now support ordering based on the dot modifier even when `random` is used.
11+
- 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.
12+
- A new prop command `s:enable.*`. It conditionally adds a prop if the condition is true.
13+
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.
14+
15+
## Fixes
16+
17+
- Several conversions are now locale-independent.
18+
- In the UI for the demo, the generate button is now locked while fetching examples.
19+
- Many fixes in the docs and demo examples.

src/stack-lang.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ std::optional<symbol> repl::eval(const char* expr) noexcept{
205205
stack.pop();
206206
if(std::holds_alternative<int>(t))stack.push(std::get<int>(t));
207207
else if(std::holds_alternative<float>(t))stack.push((int)std::get<float>(t));
208-
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);}
208+
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);}
209209
else return error_t::WRONG_TYPE;
210210
return error_t::OK;
211211
}, 1}},
@@ -226,7 +226,7 @@ std::optional<symbol> repl::eval(const char* expr) noexcept{
226226
stack.pop();
227227
if(std::holds_alternative<int>(t))stack.push((float)std::get<int>(t));
228228
else if(std::holds_alternative<float>(t))stack.push(std::get<float>(t));
229-
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);}
229+
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);}
230230
else return error_t::WRONG_TYPE;
231231
return error_t::OK;
232232
}, 1}},
@@ -296,7 +296,7 @@ std::optional<symbol> repl::eval(const char* expr) noexcept{
296296
if(expr[i]==':'){
297297
if(expr[i+1]=='*'){arity = stack.size();}
298298
else{
299-
std::from_chars(expr+i+1, expr+current+end, arity);
299+
std::from_chars(expr+i+1, expr+current+end, arity,10);
300300
}
301301
}
302302

src/vs-templ.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <string_view>
44
#include <variant>
55
#include <format>
6+
#include <charconv>
67

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

133134
int idx = 0;
134135
if(str[0]=='.' || str[0]=='+' || str[0]=='-' || (str[0]>'0' && str[0]<'9')){
135-
if(_str[_str.length()-1]=='f'){str[_str.length()-1]=0;float result{};std::from_chars(str,str+_str.length()-1,result);return result;}
136-
else{int result{};std::from_chars(str,str+_str.length(),result);return result;}
136+
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;}
137+
else{int result{};std::from_chars(str,str+_str.length(),result,10);return result;}
137138
}
138139
else if(str[0]==':') {
139140
repl r(*this);

0 commit comments

Comments
 (0)