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

Improve Compiler plugin implementation #8113

Closed
astares opened this issue Dec 15, 2020 · 0 comments · Fixed by #11761
Closed

Improve Compiler plugin implementation #8113

astares opened this issue Dec 15, 2020 · 0 comments · Fixed by #11761

Comments

@astares
Copy link
Member

astares commented Dec 15, 2020

Strange hierarchy:

  • at the moment we have OCCompilerASTPlugin saying it is "I am an abtract superclass for compiler plugins." in the class comment
  • but the "dynamic" (block closure based) compiler plugins like OCCompilerDynamicASTPlugin are not implemented as a subclass - (they inherit from Object directly)
  • also 'OCCompilerASTPlugin isAbstract ' returns false at the moment
  • additionally: not all the methods in OCCompilerASTPlugin are required for a plugin - only #transformation: and #priority methods define the API called from the compiler side

=> We should cleanup and unify into the following hierarchy

  • OCCompilerPlugin (abstract)
    -- OCDynamicCompilerPlugin
    -- OCStaticCompilerPlugin
    --- FFICompilerPlugin
    --- ASTPluginMeaningOfLife

Other code problems we should directly fix:

  • also OCCompilerASTPPlugin has a class side subclassResponsibility for #priority which is fulfilled by both subclasses (ASTPluginMeaningOfLife and FFICompilerPlugin) - but it still returns a hard coded instance side #priority of 100
  • #transform is categorized/classified as API - but it is not public API (its called privately)
  • fix typo in ASTPluginMeaningOfLife>>#transform
  • the plugin classes should be in a class category 'Plugins' similar to how their tests were tagged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant