Merged
Conversation
|
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
|
takejohn
commented
Nov 5, 2024
FineArchs
approved these changes
Nov 9, 2024
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
return, break, continue文の挙動を変更します。
unreleased/jump-statements.mdの内容 (#840 で書き換えられる可能性あり):
Why
Additional info (optional)
VReturn,VBreak,VContinueをValueの下位型から外し、Control型として扱うことにします。また、名前をそれぞれCReturn,CBreak,CContinueに変更します。インタプリタの一部メソッドは
Value | Controlを返すようにし、関数やループ処理以外のメソッドは呼び出し関数がControlを返すとそれをそのまま返値とすることでControlを呼び出し元へ伝播します。例:
ASTを走査する際に先祖ノードの情報が必要となるため、
visitNode関数が引数の関数に先祖ノードの配列も渡すようにします。Controlが返ってくると処理を終了します。