Skip to content

Commit 4585c85

Browse files
committed
v0.3.11
1 parent a6781e3 commit 4585c85

File tree

6 files changed

+55
-16
lines changed

6 files changed

+55
-16
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ It can be used to statically generate new files from a template definition and a
77
Static templates can be seen as extremely simple programs serialized in XML which are interpreted by this preprocessor.
88
They consume input data (also XML) to generated output XML.
99

10-
Details about the syntax & supported features are covered in a [dedicated page](./docs/syntax.md), or you might want to check some of the [examples](./examples/).
10+
Details about the syntax & supported features are covered in a [dedicated page](./docs/syntax.md), or you might want to check some [examples](./examples/).
1111

1212
## Examples
1313

@@ -25,9 +25,9 @@ and
2525

2626
```xml
2727
<ul>
28-
<s:for src="/items/" sort-by="$~prop-a" order-by="desc">
28+
<s:for src="/items/" sort-by="~prop-a" order-by="desc">
2929
<s:item>
30-
<li><s:value src="$~prop-a"/>: <s:value src="$~!txt"/></li>
30+
<li><s:value src="~prop-a"/>: <s:value src="~!txt"/></li>
3131
</s:item>
3232
</s:for>
3333
</ul>
@@ -73,7 +73,7 @@ with both files added via pipes, like `vs.tmpl <(cat template.xml) <(cat data.xm
7373

7474
## Installation
7575

76-
```
76+
```bash
7777
meson setup build
7878
meson install -C build
7979
```

RELEASE.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
## v0.3.11
22

3+
There has been much more progress than anticipated, and most features needed to reach `v0.4.1` have been filled in already.
4+
This release is to make sure `vs` can properly use the newly supported syntax in its code and examples.
5+
Subsequent milestones have been rescheduled, and next new branch `v0.4.x` will be mostly for consolidation, documentation and to incrementally improve the quality of code.
6+
As such, I am splitting this release here, leaving the two leftover commands for `v0.3.13`.
7+
38
### New features
49

510
- [x] Introduced `include` to load more template files. Please, notice that checks to avoid circular dependencies are to be performed externally.
611
- [ ] All the remaining prop-based commands.
12+
- [x] `value`
13+
- [x] `prop`
14+
- [ ] `for`
15+
- [ ] `for-prop`
716
- [x] Loading the environment of a preprocessor is now possible via `load_env`.
17+
- [x] Improved handling of some expressions making them less verbose.
18+
- [x] Better (and colourful) logging!
819

920
### Bug fixing
1021

1122
- Fixed several broken maths operations like `*`.
1223

1324
### Breaking changes
1425

15-
The interface of `preprocessor` was changed one again to support the loader function. Minimal changes are expected downstream.
26+
The interface of `preprocessor` was changed once again to support the XML loader function.
27+
Minimal changes are expected downstream, based on your prior usage.

TODO.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,24 @@ This is a list of commands which are currently supported:
4040

4141
## `v0.3.11`
4242

43-
- [ ] Add support for all props-based commands.
4443
- [x] Complete more of the repl vm operator to cover specs.
45-
46-
## `v0.3.13`
47-
4844
- [x] Complete more of the repl vm operator to cover specs.
4945
- [x] Add environment data when used as a lib.
46+
- [x] `include` (only fs when used via CLI)
5047

51-
## `v0.4.x`
48+
## `v0.3.13`
5249

53-
- [x] `include` (only fs when used via CLI)
50+
- [ ] Add support for all props-based commands.
5451

55-
## `v0.5.x`
52+
## `v0.4.1`
5653

5754
- [ ] Add `random` as a proper `order-by` supported value (I must be able to specify the seed when building the document too).
5855

56+
## `v0.4.x`
57+
58+
- [ ] Much more robust test-suite with higher coverage.
59+
- [ ] Optimization for lower-end systems by reducing explicit memory allocations if possible and adopting string views.
60+
5961
## `v0.8.x`
6062

6163
- [ ] Add sqlite backend in place of input XML data.

docs/releases/v0.3.11.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## v0.3.11
2+
3+
There has been much more progress than anticipated, and most features needed to reach `v0.4.1` have been filled in already.
4+
This release is to make sure `vs` can properly use the newly supported syntax in its code and examples.
5+
Subsequent milestones have been rescheduled, and next new branch `v0.4.x` will be mostly for consolidation, documentation and to incrementally improve the quality of code.
6+
As such, I am splitting this release here, leaving the two leftover commands for `v0.3.13`.
7+
8+
### New features
9+
10+
- [x] Introduced `include` to load more template files. Please, notice that checks to avoid circular dependencies are to be performed externally.
11+
- [ ] All the remaining prop-based commands.
12+
- [x] `value`
13+
- [x] `prop`
14+
- [ ] `for`
15+
- [ ] `for-prop`
16+
- [x] Loading the environment of a preprocessor is now possible via `load_env`.
17+
- [x] Improved handling of some expressions making them less verbose.
18+
- [x] Better (and colourful) logging!
19+
20+
### Bug fixing
21+
22+
- Fixed several broken maths operations like `*`.
23+
24+
### Breaking changes
25+
26+
The interface of `preprocessor` was changed once again to support the XML loader function.
27+
Minimal changes are expected downstream, based on your prior usage.

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
project(
22
'vs-templ',
33
['cpp'],
4-
version: '0.3.10',
4+
version: '0.3.11',
55
meson_version: '>= 1.1',
66
default_options: ['cpp_std=c++20'],
77
)

src/vs-templ.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
namespace vs{
1313
namespace templ{
1414

15-
const float EPS = 10e-5;
16-
1715
void preprocessor::init(const pugi::xml_node& root_data, const pugi::xml_node& root_template,const char* prefix, logfn_t _logfn, loadfn_t _loadfn, uint64_t seed){
1816
if(_logfn!=nullptr)logfn=_logfn;
1917
if(_loadfn!=nullptr)loadfn=_loadfn;
@@ -50,7 +48,7 @@ std::optional<concrete_symbol> preprocessor::resolve_expr(const std::string_view
5048

5149
pugi::xml_node ref;
5250
if(base!=nullptr) ref = *base;
53-
51+
5452
int idx = 0;
5553
if(str[0]=='.' || str[0]=='+' || str[0]=='-' || (str[0]>'0' && str[0]<'9')){
5654
if(_str[_str.length()-1]=='f')return (float)atof(str);

0 commit comments

Comments
 (0)