Skip to content

Commit f1b52e7

Browse files
committed
Preparing v0.4.5
1 parent 669fd6e commit f1b52e7

File tree

7 files changed

+89
-9
lines changed

7 files changed

+89
-9
lines changed

RELEASE.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
11
## v0.4.5
22

33
This release has not visible changes in its functionality (aside for some subtle bug fixes).
4-
The main objectives were:
4+
Which is good, it means the language itself is getting stable.
5+
The main objectives for this release were:
56

67
- Reducing complexity and verbosity for most of the code
78
- Removing obsolete or unused features from earlier revisions
8-
- Better documentation of the public interface.
9+
- Better documentation of its public interface.
10+
- Improved tests (so that I can validate the implementation so far)
11+
12+
So, a boring one! But it means that a "final" v1 is getting close.
13+
Basically all that is left are better tests to see if all commands are working as expected, better documentation and some code optimization.
14+
15+
## Fixes
16+
17+
- Fixed behaviour of filters in cycles. Now they always used meta-expressions only (no prefix `:` in that case).
18+
- Fixed behaviour of `for-range` with negative increments to match specs.
19+
- Fixed behaviour of `~!txt` to return the concatenation of all _cdata_ and _pcdata_ children, not just the first one.
920

1021
## Breaking changes
1122

1223
The interface to build the preprocessor is now a configuration object.
1324
This is done to avoid verbosity, and to allow for the definition of more fields if so needed.
1425
In most cases, using the new interface is just as simple as placing braces between the original args.
26+
27+
## Internal changes
28+
29+
- Code cleanup.
30+
- Speed up `O(nm)` children detection in cycles avoiding multiple passes.
31+
- Rework the mechanisms used in `order-by`

TODO.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
## `v0.4.5`
44

55
- [x] Code cleanup.
6-
- [x] Speed up `O(nm)` children detection in cycles.
7-
- [ ] `string_view` version of `strnatcmp` to optimize the dot comparisons
6+
- [x] Speed up `O(nm)` children detection in cycles avoiding multiple passes.
87
- [x] Rework the mechanisms used in `order-by`
9-
- [ ] and fill missing comparisons in the RPN vm
8+
- [x] More tests covering the language features
109

1110
## `v0.4.7`
1211

1312
- [ ] Properly show ctx information while logging
1413
- [ ] In the UI for the demo, add a loader as the first boot is quite slow
1514
- [ ] Fill in the docs at least of the public interface
15+
- [ ] `string_view` version of `strnatcmp` to optimize the dot comparisons
16+
- [ ] and fill missing comparisons in the RPN vm
1617

1718
## `v0.4.x`
1819

docs/releases/v0.4.5.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
This release has not visible changes in its functionality (aside for some subtle bug fixes).
2+
Which is good, it means the language itself is getting stable.
3+
The main objectives for this release were:
4+
5+
- Reducing complexity and verbosity for most of the code
6+
- Removing obsolete or unused features from earlier revisions
7+
- Better documentation of its public interface.
8+
- Improved tests (so that I can validate the implementation so far)
9+
10+
So, a boring one! But it means that a "final" v1 is getting close.
11+
Basically all that is left are better tests to see if all commands are working as expected, better documentation and some code optimization.
12+
13+
## Fixes
14+
15+
- Fixed behaviour of filters in cycles. Now they always used meta-expressions only (no prefix `:` in that case).
16+
- Fixed behaviour of `for-range` with negative increments to match specs.
17+
- Fixed behaviour of `~!txt` to return the concatenation of all _cdata_ and _pcdata_ children, not just the first one.
18+
19+
## Breaking changes
20+
21+
The interface to build the preprocessor is now a configuration object.
22+
This is done to avoid verbosity, and to allow for the definition of more fields if so needed.
23+
In most cases, using the new interface is just as simple as placing braces between the original args.
24+
25+
## Internal changes
26+
27+
- Code cleanup.
28+
- Speed up `O(nm)` children detection in cycles avoiding multiple passes.
29+
- Rework the mechanisms used in `order-by`

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.4.4',
4+
version: '0.4.5',
55
meson_version: '>= 1.1',
66
default_options: ['cpp_std=c++20'],
77
)

src/vs-templ.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,13 @@ std::optional<symbol> preprocessor::resolve_expr(const std::string_view& _str, c
249249
ref=as<const pugi::xml_node>(tmp.value());
250250
}
251251
}
252-
if(strcmp(str+idx+1,"!txt")==0) return ref.text().as_string();
252+
if(strcmp(str+idx+1,"!txt")==0){
253+
std::string txt;
254+
for(auto child: ref.children()){
255+
if(child.type()==pugi::node_pcdata || child.type()==pugi::node_cdata) txt+=child.text().as_string();
256+
}
257+
return txt;
258+
}
253259
else if(strcmp(str+idx+1,"!tag")==0) return ref.name();
254260
else return ref.attribute(str+idx+1).as_string();
255261
}

test/cases/complex-paths.xml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,28 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<test xmlns:s="vs.templ">
3+
<data attr-1="0">
4+
<root attr-1="1">
5+
<child attr-1="2">text<![CDATA[a]]>a</child>
6+
</root>
7+
</data>
8+
9+
<template>
10+
<doc>
11+
<a><s:value src="/~attr-1"/></a>
12+
<a><s:value src="/root/~attr-1"/></a>
13+
<a><s:value src="/root/child/~attr-1"/></a>
14+
<a><s:value src="/root/child/~!txt"/></a>
15+
<a><s:value src="/root/child/~!tag"/></a>
16+
</doc>
17+
</template>
18+
19+
<expects>
20+
<doc>
21+
<a>0</a>
22+
<a>1</a>
23+
<a>2</a>
24+
<a>textaa</a>
25+
<a>child</a>
26+
</doc>
27+
</expects>
28+
</test>

test/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ vs_templ_test = executable(
55
install: false,
66
)
77

8-
cases = ['id', 'for-range', 'for.tag', 'for-props.tag', 'calc', 'when.prop']
8+
cases = ['id', 'for-range', 'for.tag', 'for-props.tag', 'calc', 'when.prop', 'complex-paths']
99

1010
foreach case : cases
1111

0 commit comments

Comments
 (0)