Skip to content
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

Codegen visitor functions #23

Closed
wants to merge 5 commits into from
Closed

Codegen visitor functions #23

wants to merge 5 commits into from

Commits on Aug 27, 2019

  1. Add codegen for visit_* and leave_* methods on CSTTransform and CSTVi…

    …sitor.
    
    This allows Pyre to typecheck returns inside visitors for us.
    Jennifer Taylor committed Aug 27, 2019
    Configuration menu
    Copy the full SHA
    9c51279 View commit details
    Browse the repository at this point in the history
  2. Add unit test to verify that codegen is clean.

    We want to make sure that the generated function stubs stay in sync with
    the node definitions. So, make a unit test that fails if codegen generates
    a different file than the existing file, so that somebody modifying code
    knows they need to re-run codegen.
    Jennifer Taylor committed Aug 27, 2019
    Configuration menu
    Copy the full SHA
    346ab7a View commit details
    Browse the repository at this point in the history
  3. Add a tox environment for running codegen.

    Jennifer Taylor committed Aug 27, 2019
    Configuration menu
    Copy the full SHA
    c2c32fc View commit details
    Browse the repository at this point in the history
  4. Add a BaseStatement type.

    Adds a BaseStatement type which can be used to specify in types that you can
    accept either a compound statement or a simple statement line.
    Jennifer Taylor committed Aug 27, 2019
    Configuration menu
    Copy the full SHA
    23a3ddd View commit details
    Browse the repository at this point in the history
  5. Calculate necessity of MaybeSentinel/RemovalSentinel based on usage.

    There are a lot of nodes that cannot be removed or converted to maybes, such as
    most of the Op tokens. It would be a bit of a lie to codegen leave_* methods
    that allow these nodes to be converted, only to throw a runtime error later. So,
    upgrade the codegen to allow us to see whether certain nodes are used in conjunction
    with a MaybeSentinel/None, or inside a Sequence, to inform ourselves as to when to
    allow MaybeSentinel or RemovalSentinel.
    Jennifer Taylor committed Aug 27, 2019
    Configuration menu
    Copy the full SHA
    68ab398 View commit details
    Browse the repository at this point in the history