Skip to content

Commit 9626809

Browse files
author
Hana Dusíková
committed
fixes for edg
1 parent 6623502 commit 9626809

File tree

9 files changed

+26
-10
lines changed

9 files changed

+26
-10
lines changed

include/ctll/grammars.hpp

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,31 @@ template <auto A, decltype(A) B> struct range {
6060
template <auto V, typename = std::enable_if_t<(A <= V) && (V <= B)>> constexpr inline range(term<V>) noexcept;
6161
};
6262

63+
#ifdef __EDG__
64+
template <auto V, auto... Set> struct contains {
65+
static constexpr bool value = ((Set == V) || ... || false);
66+
};
67+
#endif
68+
6369
// match terms defined in set
6470
template <auto... Def> struct set {
6571
constexpr inline set() noexcept { };
66-
//template <auto V> constexpr set(term<V>) noexcept requires ((Def == V) || ... || false);
67-
template <auto V, typename = std::enable_if_t<((Def == V) || ... || false)>> constexpr inline set(term<V>) noexcept;
72+
#ifdef __EDG__
73+
template <auto V, typename = std::enable_if_t<contains<V, Def...>::value>> constexpr inline set(term<V>) noexcept;
74+
#else
75+
template <auto V, typename = std::enable_if_t<((Set == V) || ... || false)>> constexpr inline set(term<V>) noexcept;
76+
#endif
6877
};
6978

7079
// match terms not defined in set
7180
template <auto... Def> struct neg_set {
7281
constexpr inline neg_set() noexcept { };
73-
//template <auto V> constexpr set(term<V>) noexcept requires ((Def == V) || ... || false);
74-
template <auto V, typename = std::enable_if_t<((Def != V) && ... && true)>> constexpr inline neg_set(term<V>) noexcept;
82+
83+
#ifdef __EDG__
84+
template <auto V, typename = std::enable_if_t<!contains<V, Def...>::value>> constexpr inline neg_set(term<V>) noexcept;
85+
#else
86+
template <auto V, typename = std::enable_if_t<!(Set == V) || ... || false)>> constexpr inline neg_set(term<V>) noexcept;
87+
#endif
7588
};
7689

7790
// AUGMENTED grammar which completes user-defined grammar for all other cases

include/ctre/actions/asserts.inc.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ template <auto V, typename... Ts, typename Parameters> static constexpr auto app
1212
}
1313

1414
#endif
15-

include/ctre/actions/set.inc.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,3 @@ template <auto V, auto B, auto A, typename... Ts, typename Parameters> static co
6464
}
6565

6666
#endif
67-

include/ctre/evaluation.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, c
245245
// (gready) repeat
246246
template <typename R, typename Iterator, typename EndIterator, size_t A, size_t B, typename... Content, typename... Tail>
247247
constexpr inline R evaluate_recursive(size_t i, const Iterator begin, Iterator current, const EndIterator end, R captures, ctll::list<repeat<A,B,Content...>, Tail...> stack) {
248-
if ((i < B) || (B == 0)) {
248+
if ((B == 0) || (i < B)) {
249249

250250
// a*ab
251251
// aab

include/ctre/id.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ template <auto... Name, typename T> constexpr auto operator==(id<Name...>, T) no
1818
}
1919

2020

21-
#endif
21+
#endif

include/ctre/literals.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "wrapper.hpp"
88
#include "id.hpp"
99

10+
#ifndef __EDG__
1011

1112
namespace ctre {
1213

@@ -123,3 +124,5 @@ template <ctll::fixed_string input> CTRE_FLATTEN constexpr CTRE_FORCE_INLINE aut
123124
} // ctre
124125

125126
#endif
127+
128+
#endif

include/ctre/return_type.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ template <typename Iterator, typename... Captures> regex_results(Iterator, ctll:
266266

267267
// support for structured bindings
268268

269+
#ifndef __EDG__
269270
#ifdef __clang__
270271
#pragma clang diagnostic push
271272
#pragma clang diagnostic ignored "-Wmismatched-tags"
@@ -285,5 +286,6 @@ namespace std {
285286
#ifdef __clang__
286287
#pragma clang diagnostic pop
287288
#endif
289+
#endif
288290

289291
#endif

include/ctre/utility.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
#define CTRE_FLATTEN __attribute__((flatten))
1010
#endif
1111

12-
#endif
12+
#endif

include/ctre/wrapper.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,4 @@ template <typename RE> regular_expression(RE) -> regular_expression<RE>;
107107

108108
}
109109

110-
#endif
110+
#endif

0 commit comments

Comments
 (0)