|
@@ -9,7 +9,7 @@ namespace pkpy{
|
|
|
typedef uint8_t TokenIndex;
|
|
typedef uint8_t TokenIndex;
|
|
|
|
|
|
|
|
constexpr const char* kTokens[] = {
|
|
constexpr const char* kTokens[] = {
|
|
|
- "is not", "not in",
|
|
|
|
|
|
|
+ "is not", "not in", "yield from",
|
|
|
"@eof", "@eol", "@sof",
|
|
"@eof", "@eol", "@sof",
|
|
|
"@id", "@num", "@str", "@fstr",
|
|
"@id", "@num", "@str", "@fstr",
|
|
|
"@indent", "@dedent",
|
|
"@indent", "@dedent",
|
|
@@ -231,6 +231,12 @@ struct Lexer {
|
|
|
add_token(TK("is not"));
|
|
add_token(TK("is not"));
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
|
|
+ }else if(name == "yield"){
|
|
|
|
|
+ if(strncmp(curr_char, " from", 5) == 0){
|
|
|
|
|
+ curr_char += 5;
|
|
|
|
|
+ add_token(TK("yield from"));
|
|
|
|
|
+ return 0;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
add_token(kTokenKwMap.at(name));
|
|
add_token(kTokenKwMap.at(name));
|
|
|
} else {
|
|
} else {
|