You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhance performance of synthesize_collect expressions.
- Implemented `synthesize_collect_expression` to optimize the combination of synthesis and collection operations, improving performance for complex data structures.
- Updated `README.md` to clarify the functionality of bracket expressions.
- Refined `synthesize_expression` error messages for better clarity.
- Removed redundant `build_collection` method in favor of the new `build_container` function, streamlining the codebase.
- Adjusted `CHANGELOG.md` to reflect these significant changes and improvements.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,10 @@
2
2
3
3
## Release v0.6.0 (Under Development)
4
4
5
+
* Implemented optimized `synthesize_collect_expression` that combines synthesize and collect operations into a single semantic action, eliminating redundant attribute stack operations and significantly improving performance for complex data structure construction.
5
6
* Replaced the basic regular expression (BRE) implementation with bracket expressions (`_bx`). This change improves performance and reduces code complexity as the previous implementation was only partially complete and primarily used for character sets or ranges. The new bracket expressions provide the same functionality with better optimization opportunities in the expression tree, resulting in smaller code size, faster parsing and faster compilation times.
6
7
* Completely redesigned repeat mechanism with a highly optimized implementation that dramatically reduces bytecode size and significantly improves parsing performance for repetitive patterns. Introduced more expressive control directives: `repeat<min,max>[e]` for bounded repetition, `at_least<min>[e]` for minimum repetition, `at_most<max>[e]` for maximum repetition, and `exactly<count>[e]` for fixed repetition.
7
8
* Added specialized repeat opcodes that eliminate redundant stack operations and reduce instruction count for common repetition patterns.
8
-
* Implemented tail-call optimization for repeat operations to prevent stack overflow on deeply nested repetitions.
9
9
* Implemented an optimized whitespace skipping mechanism, replacing the previous implementation for better performance.
10
10
* Fixed critical issues with `eol` and `eoi` combinators that were incorrectly interacting with whitespace skipping logic.
11
11
* Added specialized fast paths for common whitespace patterns to improve parsing speed in typical scenarios.
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -202,7 +202,7 @@ Quick Reference
202
202
|`chr(c)`| Matches the UTF-8, UTF-16, or UTF-32 character *c*. |
203
203
|`chr(c1, c2)`| Matches characters in the UTF-8, UTF-16, or UTF-32 interval \[*c1*-*c2*\]. |
204
204
|`str(s)`| Matches the sequence of characters in the string *s*. |
205
-
|`bkt(s)`| Bracket expression matching a set of characters or character ranges, optionally negated with a `^` prefix. Can be referred to informally as a character bucket expression. |
205
+
|`bkt(s)`| Bracket expression matching a set of characters and/or character intervals in string *s*, optionally negated with a *^* prefix. |
206
206
|`any`| Matches any single character. |
207
207
|`any(flags)`| Matches a character exhibiting any of the character properties. |
208
208
|`all(flags)`| Matches a character with all of the character properties. |
@@ -236,7 +236,7 @@ Quick Reference
236
236
|`_bx`| Bracket Expression | Bracket expression containing multiple caracters and character ranges. |
237
237
|`_icx`| Case Insensitive Character Expression | Same as `_cx` but case insensitive |
238
238
|`_isx`| Case Insensitive String Expression | Same as `_sx` but case insensitive |
239
-
|`_ibx`| Case Insensitive Regular Expression | Same as `_bx` but case insensitive |
239
+
|`_ibx`| Case Insensitive Bracket Expression | Same as `_bx` but case insensitive |
240
240
|`_scx`| Case Sensitive Character Expression | Same as `_cx` but case sensitive |
241
241
|`_ssx`| Case Sensitive String Expression | Same as `_sx` but case sensitive |
242
242
|`_sbx`| Case Sensitive Bracket Expression | Same as `_bx` but case sensitive |
static_assert(sizeof...(ElementArgs) > 0, "no element types provided to collect expression");
1953
+
static_assert(std::is_constructible_v<typename Container::value_type, std::decay_t<ElementArgs>...>, "synthesized element type does not support the provided constructor argument types");
1954
+
static_assert(std::is_constructible_v<T, Container>, "synthesized type T not constructible from Container type argument");
1955
+
using base_type = unary_encoder_expression_interface<synthesize_collect_expression<E1, Factory, T, Container, ElementArgs...>, E1>;
0 commit comments