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

Allow inlining one-line functions #139

Merged
merged 1 commit into from
May 13, 2022
Merged

Commits on May 13, 2022

  1. Allow inlining one-line functions

    This implements the simplest possible implementation of inlining
    functions. It only supports a function consisting of a single `return`,
    when it has been explicitly named as `i_whatever`. Basically, this works
    in cases where you might want to use a macro, excpet this gives the
    minifier full visibility through it.
    
    The simplicity of this implementation means that it's likely possible to
    get into trouble by marking certain functions as to-be-inlined. In
    particular, I'm pretty sure the following will break it:
    - inlining overloaded functions
    - inlining a function into a scope which has a local shadowing a global,
      where the inlined function refers to that global (though this will
      also break a macro)
    jwatzman committed May 13, 2022
    Configuration menu
    Copy the full SHA
    4db76cd View commit details
    Browse the repository at this point in the history