forked from OctaForge/libcubescript
use the new algo stuff
This commit is contained in:
parent
634277a31c
commit
64d770474f
|
@ -1431,10 +1431,10 @@ static bool compileblockstr(GenState &gs, ostd::ConstCharRange str, bool macro)
|
||||||
char *buf = (char *)&gs.code[gs.code.size()];
|
char *buf = (char *)&gs.code[gs.code.size()];
|
||||||
int len = 0;
|
int len = 0;
|
||||||
while (!str.empty()) {
|
while (!str.empty()) {
|
||||||
int n = strcspn(str.data(), "\r/\"@]\0");
|
const char *p = str.data();
|
||||||
memcpy(&buf[len], str.data(), n);
|
str = ostd::find_one_of(str, ostd::ConstCharRange("\r/\"@]"));
|
||||||
len += n;
|
memcpy(&buf[len], p, str.data() - p);
|
||||||
str.pop_front_n(n);
|
len += str.data() - p;
|
||||||
if (str.empty())
|
if (str.empty())
|
||||||
goto done;
|
goto done;
|
||||||
switch (str.front()) {
|
switch (str.front()) {
|
||||||
|
@ -1451,7 +1451,8 @@ static bool compileblockstr(GenState &gs, ostd::ConstCharRange str, bool macro)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case '/':
|
case '/':
|
||||||
if (str[1] == '/') str.pop_front_n(strcspn(str.data(), "\n\0"));
|
if (str[1] == '/')
|
||||||
|
str = ostd::find(str, '\n');
|
||||||
else {
|
else {
|
||||||
buf[len++] = str.front();
|
buf[len++] = str.front();
|
||||||
str.pop_front();
|
str.pop_front();
|
||||||
|
|
Loading…
Reference in a new issue