mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-21 20:10:17 +00:00
fix a bug
This commit is contained in:
parent
c4cf62f02f
commit
c4cde994f8
@ -1236,14 +1236,18 @@ __EAT_DOTS_END:
|
|||||||
if(is_raw_string_used(token.type)){
|
if(is_raw_string_used(token.type)){
|
||||||
auto it = token_indices.find(token.sv());
|
auto it = token_indices.find(token.sv());
|
||||||
if(it == token_indices.end()){
|
if(it == token_indices.end()){
|
||||||
token_indices[token.sv()] = token_indices.size();
|
token_indices[token.sv()] = 0;
|
||||||
// assert no '\n' in token.sv()
|
// assert no '\n' in token.sv()
|
||||||
for(char c: token.sv()) if(c=='\n') PK_FATAL_ERROR();
|
for(char c: token.sv()) if(c=='\n') PK_FATAL_ERROR();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ss << "=" << (int)token_indices.size() << '\n'; // L3: raw string count
|
ss << "=" << (int)token_indices.size() << '\n'; // L3: raw string count
|
||||||
for(auto& kv: token_indices) ss << kv.first << '\n'; // L4: raw strings
|
int index = 0;
|
||||||
|
for(auto& kv: token_indices){
|
||||||
|
ss << kv.first << '\n'; // L4: raw strings
|
||||||
|
kv.second = index++;
|
||||||
|
}
|
||||||
|
|
||||||
ss << "=" << (int)tokens.size() << '\n'; // L5: token count
|
ss << "=" << (int)tokens.size() << '\n'; // L5: token count
|
||||||
for(int i=0; i<tokens.size(); i++){
|
for(int i=0; i<tokens.size(); i++){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user