Skip to content

Commit 921ef78

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents bb56d63 + 486344d commit 921ef78

File tree

9 files changed

+625
-538
lines changed

9 files changed

+625
-538
lines changed

.clang-tidy

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ HeaderFilterRegex: ''
1919
FormatStyle: none
2020

2121
CheckOptions:
22-
- key: readability-identifier-length.IgnoredVariableNames
23-
value: 'x|y|z'
24-
- key: readability-identifier-length.IgnoredParameterNames
25-
value: 'x|y|z'
22+
readability-identifier-length.IgnoredVariableNames: 'x|y|z|id|ch'
23+
readability-identifier-length.IgnoredParameterNames: 'x|y|z|id|ch'
2624

2725

2826

examples/compile_test.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#include <cons_expr/cons_expr.hpp>
22
#include <format>
33

4+
using cons_expr_type = lefticus::cons_expr<std::uint16_t, char, long long, long double>;
5+
46
constexpr long long add(long long x, long long y) { return x + y; }
57

68
consteval auto make_scripted_function()
79
{
8-
lefticus::cons_expr<> evaluator;
10+
cons_expr_type evaluator;
911

1012
evaluator.add<&add>("add");
1113

@@ -23,15 +25,15 @@ consteval auto make_scripted_function()
2325

2426

2527
[[maybe_unused]] const auto result = evaluator.sequence(
26-
evaluator.global_scope, std::get<typename lefticus::cons_expr<>::list_type>(evaluator.parse(input).first.value));
28+
evaluator.global_scope, std::get<typename cons_expr_type::list_type>(evaluator.parse(input).first.value));
2729

2830
return std::bind_front(evaluator.make_callable<long long(long long, long long)>("sum"), evaluator);
2931
}
3032

3133

3234
int main()
3335
{
34-
// the kicker here is that this lambda is a full self contained script environment
36+
// the kicker here is that this lambda is a full self-contained script environment
3537
// that was all parsed and optimized at compile-time
3638
auto func = make_scripted_function();
3739

examples/speed_test.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ constexpr long long add(long long x, long long y) { return x + y; }
55

66
void display(long long i) { std::cout << i << '\n'; }
77

8+
using cons_expr_type = lefticus::cons_expr<std::uint16_t, char, long long, double>;
9+
810
auto evaluate(std::string_view input)
911
{
10-
lefticus::cons_expr<> evaluator;
12+
cons_expr_type evaluator;
1113

1214
evaluator.add<&add>("add");
1315
evaluator.add<&display>("display");
1416

1517
return evaluator.sequence(
16-
evaluator.global_scope, std::get<typename lefticus::cons_expr<>::list_type>(evaluator.parse(input).first.value));
18+
evaluator.global_scope, std::get<typename cons_expr_type::list_type>(evaluator.parse(input).first.value));
1719
}
1820

1921
template<typename Result> Result evaluate_to(std::string_view input)

0 commit comments

Comments
 (0)