diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-10-02 22:06:32 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-10-02 23:20:03 +0900 |
commit | 9059dfce12995451a4374330baab49177fa717be (patch) | |
tree | 2c31bbba49d44a5ffe6914044c6a5be2f021b722 /parse.y | |
parent | 63e504d6e65765740a592ee785147e5eff0d9aed (diff) |
`yield` cannot be placed outside methods even in blocks
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -4349,7 +4349,7 @@ k_return : keyword_return k_yield : keyword_yield { - if (!p->ctxt.in_defined && !p->ctxt.in_def && !dyna_in_block(p)) + if (!p->ctxt.in_defined && !p->ctxt.in_def && !compile_for_eval) yyerror1(&@1, "Invalid yield"); } ; |