mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-24 21:40:16 +00:00
fix compile error in msvc
This commit is contained in:
parent
1a9e9dc752
commit
b1f93cfc72
@ -5,10 +5,10 @@ namespace pkpy{
|
|||||||
SourceData::SourceData(std::string_view source, const Str& filename, CompileMode mode): filename(filename), mode(mode) {
|
SourceData::SourceData(std::string_view source, const Str& filename, CompileMode mode): filename(filename), mode(mode) {
|
||||||
int index = 0;
|
int index = 0;
|
||||||
// Skip utf8 BOM if there is any.
|
// Skip utf8 BOM if there is any.
|
||||||
if (strncmp(source.begin(), "\xEF\xBB\xBF", 3) == 0) index += 3;
|
if (strncmp(source.data(), "\xEF\xBB\xBF", 3) == 0) index += 3;
|
||||||
// Drop all '\r'
|
// Drop all '\r'
|
||||||
SStream ss;
|
SStream ss;
|
||||||
while(index < source.length()){
|
while(index < source.size()){
|
||||||
if(source[index] != '\r') ss << source[index];
|
if(source[index] != '\r') ss << source[index];
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user