Title: Lwhile interpreter exceeds RecursionLimit · Issue #22 · IUCompilerCourse/python-student-support-code · GitHub
Open Graph Title: Lwhile interpreter exceeds RecursionLimit · Issue #22 · IUCompilerCourse/python-student-support-code
X Title: Lwhile interpreter exceeds RecursionLimit · Issue #22 · IUCompilerCourse/python-student-support-code
Description: Might not be that big of an issue but running InterpLwhile().interp(prog) on a program that has nested loops seems to cause a RecursionLimit exception rather quickly. class InterpLwhile(InterpLif): def interp_stmt(self, s, env, cont): ma...
Open Graph Description: Might not be that big of an issue but running InterpLwhile().interp(prog) on a program that has nested loops seems to cause a RecursionLimit exception rather quickly. class InterpLwhile(InterpLif):...
X Description: Might not be that big of an issue but running InterpLwhile().interp(prog) on a program that has nested loops seems to cause a RecursionLimit exception rather quickly. class InterpLwhile(InterpLif):...
Opengraph URL: https://github.com/IUCompilerCourse/python-student-support-code/issues/22
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Lwhile interpreter exceeds RecursionLimit","articleBody":"Might not be that big of an issue but running `InterpLwhile().interp(prog)` on a program that has nested loops seems to cause a RecursionLimit exception rather quickly.\r\n\r\n```\r\nclass InterpLwhile(InterpLif):\r\n\r\n def interp_stmt(self, s, env, cont):\r\n match s:\r\n case While(test, body, []):\r\n if self.interp_exp(test, env):\r\n self.interp_stmts(body + [s] + cont, env)\r\n else:\r\n return self.interp_stmts(cont, env)\r\n case _:\r\n return super().interp_stmt(s, env, cont)\r\n\r\nif __name__ == '__main__':\r\n\r\n prog=\"\"\"\r\nx = 50\r\nwhile x \u003e 0:\r\n y = 2\r\n while y != 0:\r\n y = y - 1\r\n x = x - 1\r\nprint(x)\r\n\"\"\"\r\n\r\n InterpLwhile().interp(parse(prog))\r\n```\r\n\r\nThe above example does not work without using `sys.setrecursionlimit(...)`. ","author":{"url":"https://github.com/waynee95","@type":"Person","name":"waynee95"},"datePublished":"2023-07-14T17:47:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/22/python-student-support-code/issues/22"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:942260bb-9b3b-1443-641b-c0428917eb4f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9ED0:1A425C:4DB7C3:65C37A:696B4345 |
| html-safe-nonce | ce1f4e51977e4cc6faedba91f77f25f4875b7f4e7aae0ba83f2b8e8600ca5e38 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RUQwOjFBNDI1Qzo0REI3QzM6NjVDMzdBOjY5NkI0MzQ1IiwidmlzaXRvcl9pZCI6Ijg0MjA5ODc5OTIxNDE0MTUyMzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6b54b81bf87c1bf6c9bc6315405bfaad5a86d12c564752357b9dc258e258027a |
| hovercard-subject-tag | issue:1805253877 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/IUCompilerCourse/python-student-support-code/22/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4bfa15a3864b20e48b12d268d5fb52988aaa49c6f80a52f58766898123f01b51/IUCompilerCourse/python-student-support-code/issues/22 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4bfa15a3864b20e48b12d268d5fb52988aaa49c6f80a52f58766898123f01b51/IUCompilerCourse/python-student-support-code/issues/22 |
| og:image:alt | Might not be that big of an issue but running InterpLwhile().interp(prog) on a program that has nested loops seems to cause a RecursionLimit exception rather quickly. class InterpLwhile(InterpLif):... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | waynee95 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/IUCompilerCourse/python-student-support-code git https://github.com/IUCompilerCourse/python-student-support-code.git |
| octolytics-dimension-user_id | 21162179 |
| octolytics-dimension-user_login | IUCompilerCourse |
| octolytics-dimension-repository_id | 398082704 |
| octolytics-dimension-repository_nwo | IUCompilerCourse/python-student-support-code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 398082704 |
| octolytics-dimension-repository_network_root_nwo | IUCompilerCourse/python-student-support-code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width