Skip to content

Conversation

@WardBrian
Copy link
Member

As discussed in #1146, the function code generation has gotten really messy. This PR doesn't fix that, but it does move it into it's own file behind a very simple interface:

val pp_functions_functors : Format.formatter -> Program.Numbered.t -> unit
(** Pretty-print all user defined functions. Creates functor structs as needed
  *)

val pp_standalone_fun_def :
  string -> Format.formatter -> 'a Program.fun_def -> unit
(** Creates functions outside the model namespaces which only call the ones
   inside the namespaces *)

This PR changes no code, just where it is located. Hopefully it will make it easier for @SteveBronder or I to tackle the larger refactoring in the near future.

Submission Checklist

  • Run unit tests
  • Documentation
    • OR, no user-facing changes were made

Release notes

Reorganize code gen modules

Copyright and Licensing

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the BSD 3-clause license (https://opensource.org/licenses/BSD-3-Clause)

@WardBrian WardBrian added the cleanup Code simplification or clean-up label Mar 17, 2022
@WardBrian WardBrian requested a review from SteveBronder March 17, 2022 16:26
Copy link
Contributor

@SteveBronder SteveBronder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good!

@WardBrian
Copy link
Member Author

@rok-cesnovar just as an FYI, this is fine if it gets merged before the patch, it's just cut/pasting code into different files for organizational reasons and doesn't need a release note.

@rok-cesnovar
Copy link
Member

Merge away!

@WardBrian WardBrian merged commit f183934 into stan-dev:master Mar 22, 2022
@WardBrian WardBrian deleted the code-gen-cleanup branch May 10, 2022 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Code simplification or clean-up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants