facebookincubator / cinder

Cinder is Meta's internal performance-oriented production version of CPython.
https://trycinder.com
Other
3.42k stars 122 forks source link

pystone: declare vars before loops #113

Closed bennn closed 1 year ago

bennn commented 1 year ago

declare 3 vars before the while loops that mutate them

fixes type errors like this:

  ....
  File "/vol/Lib/compiler/static/type_binder.py", line 1592, in visitName
    raise TypedSyntaxError(f"Name `{node.id}` is not defined.")
  File "pystone_static_basic_lib.py", line 276
    if CharLoc >= "W" and CharLoc <= "Z":
      ^
compiler.errors.TypedSyntaxError: Name `CharLoc` is not defined.
facebook-github-bot commented 1 year ago

@DinoV has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 1 year ago

@DinoV merged this pull request in facebookincubator/cinder@dda2433177e39ec99e89c639a9f0ff3169c7cb2e.