5300 Commits

Author SHA1 Message Date
Nana Sakisaka
a4910551a2 Merge pull request #75 from saki7/refine-context-naming
Rename `*_val` contexts to `*_var`
2025-10-21 10:43:27 +09:00
Nana Sakisaka
a2fcfdfea7 Rename _val to _rule_var 2025-10-21 10:31:17 +09:00
Nana Sakisaka
537ac91538 Rename _as_val to _as_var 2025-10-21 10:24:10 +09:00
Nana Sakisaka
63c6766433 Merge pull request #74 from saki7/remove-binary-parser
Remove binary parser
2025-10-21 09:59:56 +09:00
Nana Sakisaka
2f479efc09 Remove Boost.Endian dependency 2025-10-21 06:57:18 +09:00
Nana Sakisaka
ffcaf884be Remove binary parser 2025-10-21 06:26:09 +09:00
Nana Sakisaka
889ee32081 Merge pull request #73 from saki7/locals
Implement `x4::with_local<T>[...]` and `x4::with_local<T, ID>[...]`
2025-10-17 06:45:42 +09:00
Nana Sakisaka
070e592359 Fix with_local tests 2025-10-17 06:31:37 +09:00
Nana Sakisaka
a6308c3f9e Implement x4::with_local<T, ID>[...] 2025-10-11 14:13:53 +09:00
Nana Sakisaka
6edd6e485a Merge pull request #72 from saki7/remove-_where-context
Remove `_where` context
2025-10-10 09:35:01 +09:00
Nana Sakisaka
bc5a0623ed Remove _where context 2025-10-10 06:20:09 +09:00
Nana Sakisaka
81f9e21e0d Remove unused macro 2025-10-08 08:20:29 +09:00
Nana Sakisaka
dfddbbbe0d Merge pull request #71 from saki7/simplify-attribute-traits
Simplify attribute traits
2025-10-08 08:16:05 +09:00
Nana Sakisaka
fcff5b1218 Simplify attribute traits 2025-10-08 07:47:46 +09:00
Nana Sakisaka
7c77660a8a Merge pull request #70 from saki7/add-maybe-unused-to-cpo
Add `[[maybe_unused]]` to all inline variables
2025-10-07 23:38:54 +09:00
Nana Sakisaka
f115296a72 Add [[maybe_unused]] to all inline variables 2025-10-07 23:25:39 +09:00
Nana Sakisaka
92195ffcee Merge pull request #69 from saki7/include-as-directive-in-global-header
`#include` as.hpp in global header
2025-10-07 23:06:49 +09:00
Nana Sakisaka
af2d8c907d #include as.hpp in global header 2025-10-07 22:55:56 +09:00
Nana Sakisaka
c5e10a8f63 Merge pull request #68 from saki7/deprecate-_pass
Remove `_pass(ctx)`, return bool directly from semantic action
2025-10-06 04:46:12 +09:00
Nana Sakisaka
50dbcd6e66 Remove _pass(ctx), return bool directly from semantic action 2025-10-06 04:34:39 +09:00
Nana Sakisaka
cc49f6fd6b Merge pull request #67 from saki7/use-full-toolchain-version-in-cache
CI: Use full toolchain version for cache key
2025-10-06 03:48:35 +09:00
Nana Sakisaka
5b7a752237 CI: Use full toolchain version for cache key 2025-10-06 03:35:05 +09:00
Nana Sakisaka
82cfef4a89 Fix typo in has_attribute (#66) 2025-10-06 02:51:31 +09:00
Nana Sakisaka
4da8325d77 Remove redundant constructors (#65)
* Remove redundant constructors

* Define deduction guide directly
2025-10-06 01:41:51 +09:00
Nana Sakisaka
aff263bb1d Clarify behavior of iterator/attribute on failed parse (#64)
The old implementation created temporary container variable and
move-appended its elements to the exposed attribute. This commit adds
new core class `container_appender` that transparently handles insertion
in underlying parsers, without the need to creating a temporary variable.
This change simplifies the core behavior of how the attribute and
iterator is preserved (or not preserved) in failed parse attempts.

Since X4 does not allow error handlers to return anything except `void`,
X4's iterator rollback behavior is not dependent on the error handler
anymore. This commit further clarifies the iterator/attribute behavior
for all supported core parsers.

Due to the reasons described above, this commit not only acts as X4's
"companion" fix mentioned in boostorg/spirit#833, but essentially acts as
the strict superset of the corresponding work boostorg/spirit#836 in X4's
domain.
2025-10-06 00:17:48 +09:00
Nana Sakisaka
d3a1494f05 Remove confix_directive (#61) 2025-10-04 17:00:59 +09:00
Nana Sakisaka
cc023e8210 Merge pull request #58 from saki7/attr-constexpr-string
Make `x4::attr(...)` capable of holding `constexpr` string
2025-09-30 20:56:04 +09:00
Nana Sakisaka
6c5a65bf7b Make rcontext only when required (#57)
* Make `rcontext` only when required

X3 has had created `rcontext` unconditionally for any parser
invocations. That led X4 to do the same even after #37 was merged. This
commit further optimizes the implementation to create `rcontext` only
when it is required by the underlying parser. Conditions are:

- `RHS` utilizes semantic action, or
- `RuleID` has `RuleID::on_success(...)`, or
- `RuleID` has `RuleID::on_error(...)`.

This optimization resolves the last runtime overhead mentioned in #11,
where the additional reference bound to `_val` was materialized
regardless of whether it is actually used by the underlying parser.

Note that the `as<T>(...)` directive (#53) has a special case handling
that hides the existence of semantic action in the underlying parser.
This commit adds the new static bool trait `::need_rcontext` to detect
such cases.

* Assert actual type bound to `_val` in `on_error`/`on_success`
2025-09-30 19:54:36 +09:00
Nana Sakisaka
3387fb0713 Assert actual type bound to _val in on_error/on_success 2025-09-30 19:43:00 +09:00
Nana Sakisaka
69d4fc100c Make rcontext only when required
X3 has had created `rcontext` unconditionally for any parser
invocations. That led X4 to do the same even after #37 was merged. This
commit further optimizes the implementation to create `rcontext` only
when it is required by the underlying parser. Conditions are:

- `RHS` utilizes semantic action, or
- `RuleID` has `RuleID::on_success(...)`, or
- `RuleID` has `RuleID::on_error(...)`.

This optimization resolves the last runtime overhead mentioned in #11,
where the additional reference bound to `_val` was materialized
regardless of whether it is actually used by the underlying parser.

Note that the `as<T>(...)` directive (#53) has a special case handling
that hides the existence of semantic action in the underlying parser.
This commit adds the new static bool trait `::need_rcontext` to detect
such cases.
2025-09-30 19:11:31 +09:00
Nana Sakisaka
0dc0c6023e Remove TLS optimization in alternative (#56)
This partially reverts the premature optimization introduced in #50,
which would not work properly for recursive parser invocations.
2025-09-30 17:59:12 +09:00
Nana Sakisaka
a73dd2c483 Remove unused bjam features (#55)
* Remove unused bjam features

* Ignore Jamfile changes in CI
2025-09-30 15:17:56 +09:00
Nana Sakisaka
d392a7f83a Implement as<T>(...) directive (#53) 2025-09-30 11:48:27 +09:00
KakeyamaY
3ac3e4b9e2 Drop fusion associative sequence support (#54)
* Drop fusion associative sequence support

* Remove remaining piece of code

* Include missing header
2025-09-30 11:45:05 +09:00
Nana Sakisaka
afbfeb0d60 Merge pull request #52 from saki7/check-expectation-minimize
Relax expectation failure context requirement
2025-09-28 17:58:05 +09:00
Nana Sakisaka
65e04d70a7 Merge pull request #50 from saki7/attribute-alternative-guarantee
Prevent side effect on the failed branch of `alternative`
2025-09-26 21:02:20 +09:00
Nana Sakisaka
745928f7db Use temporary on left/right branches of alternative
Fixes #49
2025-09-26 20:38:17 +09:00
Nana Sakisaka
6fa5c314e7 Add traits::clear for container attribute 2025-09-26 19:48:40 +09:00
Nana Sakisaka
05bf2eb30b Migrate to Catch2 (#48)
* Migrate to Catch2

* Enable colors in Catch2

* CI: Cache Catch2

* Remove unused variable

* Supply compiler flags to `Catch2WithMain`

* CI: Fix Catch2 cache

* Fix styling
2025-09-25 17:26:35 +09:00
Nana Sakisaka
2863465a8b doc: Update the status to make the repo more open 2025-09-24 14:36:55 +09:00
Nana Sakisaka
317d76ac7f Suppress unused variable warning on CPOs (#47) 2025-09-23 23:56:32 +09:00
Nana Sakisaka
a9e5671019 Make numeric policies stateless (#46) 2025-09-23 23:45:03 +09:00
Nana Sakisaka
6faa2a944c Reduce the number of identifiers in top-level x4:: scope (#44)
* Move char_class related tags to `char_classes::`

* Reduce unnecessary identifiers in the top-level namespace

* Move `extract_*` to `numeric::`

* Move "ast/" stuff to namespace "ast::"

* Introduce helper namespace `x4::parsers::*`
2025-09-23 21:29:10 +09:00
Nana Sakisaka
47100aaf2b Introduce helper namespace x4::parsers::* 2025-09-23 21:15:45 +09:00
Nana Sakisaka
c87dd15d68 Move "ast/" stuff to namespace "ast::" 2025-09-23 20:13:07 +09:00
Nana Sakisaka
01a3d2fec9 Move extract_* to numeric:: 2025-09-23 20:04:59 +09:00
Nana Sakisaka
bd2c1f66d1 Reduce unnecessary identifiers in the top-level namespace 2025-09-23 20:02:54 +09:00
Nana Sakisaka
2ca466553f Move char_class related tags to char_classes:: 2025-09-23 18:31:13 +09:00
Nana Sakisaka
c328a29be4 More strict check for incompatible char types (#43) 2025-09-23 18:12:03 +09:00
Nana Sakisaka
945c5dd37b Improve context to make it capable of holding both lvalue/rvalue (#42) 2025-09-23 13:37:28 +09:00