Go to the documentation of this file.
24 namespace dsl = lexy::dsl;
30 return "code-point.BT-start-character";
46 return lexy::_detail::code_point_has_properties<LEXY_UNICODE_PROPERTY(xid_start)>(cp);
49 template <
typename Encoding>
52 return lexyd::ascii::_alphau::template char_class_match_swar<Encoding>(c);
60 static constexpr
auto rule =
63 static constexpr
auto value = lexy::as_string<std::string>;
72 static constexpr
auto value = lexy::as_integer<int64_t>;
77 static constexpr
auto name =
"invalid suffix on integer literal";
80 static constexpr
auto rule = [] {
83 auto regular_integer =
84 dsl::peek(dsl::lit_c<'-'> / dsl::lit_c<'+'> / dsl::digit<>) >> dsl::p<integer>;
88 return (hex_integer | regular_integer) >> suffix_error;
91 static constexpr
auto value = lexy::construct<int64_t>;
99 static constexpr
auto name =
"invalid suffix on double literal";
102 static constexpr
auto rule = [] {
103 auto integer_part =
dsl::sign + dsl::digits<>;
104 auto fraction = dsl::period >> dsl::digits<>;
105 auto exponent = (dsl::lit_c<'e'> / dsl::lit_c<'E'>) >> (
dsl::sign + dsl::digits<>);
111 auto real_part = (fraction >>
dsl::if_(exponent) | exponent) >> suffix_error;
112 auto real_number =
dsl::token(integer_part + real_part);
117 lexy::as_string<std::string> |
118 lexy::callback<BT::Any>([](std::string&& str) {
return BT::Any(std::stod(str)); });
133 static constexpr
auto value = lexy::as_string<std::string>;
150 static constexpr
auto rule = dsl::p<True> | dsl::p<False>;
151 static constexpr
auto value = lexy::construct<BT::Any>;
158 dsl::p<BooleanLiteral> | dsl::p<StringLiteral> | dsl::p<Real> | dsl::p<Integer>;
159 static constexpr
auto value = lexy::construct<BT::Any>;
constexpr auto peek_not(Rule)
Checks if at this reader position, the rule would not match.
static constexpr auto name
constexpr auto token(Rule)
Turns the arbitrary rule into a token by matching it without producing any values.
constexpr auto peek(Rule)
static constexpr auto rule
static constexpr auto rule
constexpr auto alpha_underscore
static constexpr auto rule
LEXY_CONSTEVAL auto constant(Arg &&value)
Creates a callback that produces the given value without accepting arguments.
static constexpr auto rule
constexpr void insert(int c)
#define LEXY_UNICODE_CONSTEXPR
static constexpr auto value
static constexpr auto rule
static constexpr auto value
constexpr auto single_quoted
static LEXY_UNICODE_CONSTEXPR bool char_class_match_cp(char32_t cp)
static constexpr auto name
static constexpr auto rule
static LEXY_CONSTEVAL auto char_class_name()
static constexpr auto rule
static LEXY_CONSTEVAL auto char_class_ascii()
static constexpr auto value
static constexpr auto value
static constexpr auto value
static constexpr auto rule
constexpr auto xid_start_character
constexpr auto identifier(CharClass)
Creates an identifier that consists of one or more of the given characters.
constexpr auto if_(Branch)
If the branch condition matches, matches the branch then.
static constexpr auto value
static constexpr auto value
static constexpr auto char_class_match_swar(lexy::_detail::swar_int c)
static constexpr auto value
constexpr auto capture(Token)
Captures whatever the token matches as a lexeme; does not include trailing whitespace.
static constexpr auto rule
constexpr auto sign
Matches a plus or minus sign or nothing, producing +1 or -1.
static constexpr auto value