64{
65 decorator_toks res;
66 res.label = label;
67 size_t pos{};
68 std::string_view::const_iterator it = c.begin();
69 std::advance(it, label.size());
70
71 if (*it == ':') {
72 std::advance(it, 1);
73
74 pos = std::distance(c.begin(), it);
75
76
77 auto d = c.substr(pos, c.find('[', pos) - pos);
78 if (!d.empty()) {
79 std::string d_str{d};
80 d_str.erase(std::remove_if(d_str.begin(), d_str.end(),
81 static_cast<int (*)(int)>(std::isspace)),
82 d_str.end());
84 }
85
86 std::advance(it, d.size());
87 }
88
89 if (*it == '[') {
90 std::advance(it, 1);
91
92 pos = std::distance(c.begin(), it);
93 res.param = c.substr(pos, c.find(']', pos) - pos);
94
95 std::advance(it, res.param.size() + 1);
96 }
97 else if (std::isspace(*it) != 0) {
98 std::advance(it, 1);
99 }
100
101 pos = std::distance(c.begin(), it);
102 res.text = c.substr(pos, c.find('}', pos) - pos);
105
106 return res;
107}