50#include <boost/spirit/include/qi.hpp>
51#include <boost/regex/pending/unicode_iterator.hpp>
69struct utf8_identifier_parser
70 : boost::spirit::qi::primitive_parser<utf8_identifier_parser>
72 template <
typename Context,
typename Iterator>
73 struct attribute {
typedef std::string type; };
75 template <
typename Iterator,
typename Context,
typename Skipper,
typename Attribute>
76 bool parse(Iterator& first, Iterator
const& last,
77 Context&, Skipper
const& skipper, Attribute& attr)
const
79 boost::spirit::qi::skip_over(first, last, skipper);
80 Iterator
const begin = first;
87 boost::u8_to_u32_iterator<Iterator> u(it, it, last);
95 boost::u8_to_u32_iterator<Iterator> u(it, it, last);
106 std::string matched(begin, it);
107 boost::spirit::traits::assign_to(matched, attr);
112 template <
typename Context>
113 boost::spirit::info what(Context&)
const
115 return boost::spirit::info(
"utf8_identifier");
123struct utf8_ident_boundary_parser
124 : boost::spirit::qi::primitive_parser<utf8_ident_boundary_parser>
126 template <
typename Context,
typename Iterator>
127 struct attribute {
typedef boost::spirit::unused_type type; };
129 template <
typename Iterator,
typename Context,
typename Skipper,
typename Attribute>
130 bool parse(Iterator& first, Iterator
const& last,
131 Context&, Skipper
const& skipper, Attribute&)
const
133 boost::spirit::qi::skip_over(first, last, skipper);
138 boost::u8_to_u32_iterator<Iterator> u(first, first, last);
147 template <
typename Context>
148 boost::spirit::info what(Context&)
const
150 return boost::spirit::info(
"utf8_ident_boundary");
Definition classic_utilities.hpp:41
bool parse(Iterator first, Iterator last, std::shared_ptr< bertini::node::Node > &func)
Parse a function expression from the iterator range into a node tree.
Definition function_parsers.hpp:46
Definition classic_utilities.hpp:40
Definition algorithm_builder.hpp:36
bool IsIdentStart(char32_t cp)
True if code point cp may START an identifier: any Unicode letter (ASCII A-Z a-z, plus Ω,...
Definition naming.hpp:86
bool IsIdentCont(char32_t cp)
True if code point cp may CONTINUE an identifier: any Unicode alphanumeric, one of the legacy continu...
Definition naming.hpp:95
The single policy for what makes a legal identifier (variable/symbol name).