Skip to content

Commit 6b63bd4

Browse files
committed
Added peg::udl for 'tag' user defined literal.
1 parent 1520849 commit 6b63bd4

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

language/culebra/culebra.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ struct Interpreter
547547
}
548548

549549
Value eval(const peg::Ast& ast, std::shared_ptr<Environment> env) {
550-
using peg::operator"" _;
550+
using namespace peg::udl;
551551

552552
if (debugger_) {
553553
if (ast.original_tag == "STATEMENT"_) {
@@ -715,7 +715,7 @@ struct Interpreter
715715
}
716716

717717
Value eval_call(const peg::Ast& ast, std::shared_ptr<Environment> env) {
718-
using peg::operator"" _;
718+
using namespace peg::udl;
719719

720720
Value val = eval(*ast.nodes[0], env);
721721

@@ -836,7 +836,7 @@ struct Interpreter
836836
}
837837
return rval;
838838
} else {
839-
using peg::operator"" _;
839+
using namespace peg::udl;
840840

841841
Value lval = eval(*ast.nodes[lvaloff], env);
842842

language/culebra/main.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <vector>
77

88
using namespace peg;
9+
using namespace peg::udl;
910
using namespace std;
1011

1112
bool read_file(const char* path, vector<char>& buff)

language/pl0/pl0.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <sstream>
1212

1313
using namespace peg;
14+
using namespace peg::udl;
1415
using namespace std;
1516

1617
/*

peglib.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,9 +2151,11 @@ inline constexpr unsigned int str2tag(const char* str, int h = 0) {
21512151
return !str[h] ? 5381 : (str2tag(str, h + 1) * 33) ^ static_cast<unsigned char>(str[h]);
21522152
}
21532153

2154+
namespace udl {
21542155
inline constexpr unsigned int operator "" _(const char* s, size_t) {
21552156
return str2tag(s);
21562157
}
2158+
}
21572159
#endif
21582160

21592161
template <typename Annotation>

0 commit comments

Comments
 (0)