Skip to content

Better scope prism's C API #2888

@kddnewton

Description

@kddnewton

At the moment, prism exposes a lot of structs and functions in its C API. Overall, the shape is not clearly defined. We should take a couple of steps to resolve this:

  • We should have a split between our public and private header files.
  • Ideally, I would love pm_node_t to be an opaque pointer. Because they are always heap-allocated, we should be able to get away with this.
  • The public API should be documented here: https://ruby.github.io/prism/c/index.html. At the moment, it is clear that too much is exposed.
  • Every attribute should have a defined getter macro to make it maintainable going forward, in case we need to change a name or the structure of the AST.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions