-
Notifications
You must be signed in to change notification settings - Fork 39
fix: ジャンプ文の挙動を変更 #844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ジャンプ文の挙動を変更 #844
Conversation
|
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
|
syuilo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YOSASOU
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が返ってくると処理を終了します。