Gleam features a pub modifier for constants, types, functions (internal and external), type definitions, and type aliases. Additionally, it also features an opaque modifier for type definitions and type aliases.
Presently, an construct with a modifier is represented as a different base AST node than the same construct without a modifier. For example:
In the interest of usability, we should move to make constructs with and without a modifier share the same base AST node while the construct with the modifier should have an additional child node for the modifier.
Gleam features a
pub
modifier for constants, types, functions (internal and external), type definitions, and type aliases. Additionally, it also features anopaque
modifier for type definitions and type aliases.Presently, an construct with a modifier is represented as a different base AST node than the same construct without a modifier. For example:
is represented as
and the version with the public modifier:
is represented as
In the interest of usability, we should move to make constructs with and without a modifier share the same base AST node while the construct with the modifier should have an additional child node for the modifier.
e.g.
should be represented as
This behavior also exists in tree-sitter-rust.