safe lexing with unterminated strings
parent
b3110c30b9
commit
1c9f9c8f9f
|
@ -218,7 +218,10 @@ struct GenState {
|
||||||
return *source++;
|
return *source++;
|
||||||
}
|
}
|
||||||
|
|
||||||
char current(int ahead = 0) {
|
char current(ostd::Size ahead = 0) {
|
||||||
|
if (source.size() <= ahead) {
|
||||||
|
return '\0';
|
||||||
|
}
|
||||||
return source[ahead];
|
return source[ahead];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue