Skip to content

Python Nested Union Variants - #111

Merged
Kronos3 merged 3 commits into
masterfrom
python-nest-union-variants
Oct 1, 2026
Merged

Kronos3 merged 3 commits into
masterfrom
python-nest-union-variants

Conversation

@Kronos3

@Kronos3 Kronos3 commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Closes #110

This PR changes the naming of Rust ADT enums variants in Python from using name mangling to being nested inside a scope. This keeps the naming inline with that of Rust/Scala. This PR also nests the ast definitions into a Python submodule. This also means the shadowed AST names can be properly represented in Python now. All shadowed modeling has been dropped from the bindings.

@Kronos3
Kronos3 merged commit b03c75b into master Oct 1, 2026
27 checks passed
@Kronos3
Kronos3 deleted the python-nest-union-variants branch October 1, 2026 21:27
Kronos3 added a commit that referenced this pull request Oct 11, 2026
Brings in #101-#111 on top of the Scala parity work.

Conflict resolutions:
- fpp_analysis: the Scala-ordered errors.rs/analysis.rs and the split
  semantics files are kept. #106 is re-applied inside them:
  InvalidTlmPacketSet is back to Scala's (loc, name, msg) shape and the new
  TlmPacketSetChannelsNotCovered / TlmPacketSetChannelsUsedAndOmitted
  variants sit next to it. check_channel_usage keeps Scala's per-channel
  scan in dictionary order to decide which error comes first, then lists
  every channel failing that check. The packet and packet set errors stay
  at the specifier, where Scala reports them (#106 moved them to the name).
  get_uncovered_channels(_for_node) serve the LSP quick fix. #105 makes partial_topology_map crate-private. #103 and #107 were
  already ported from the same Scala tests; one copy of each is kept.
- fpp_lsp_parser: #102's expect() in place of bump() on top of the
  lookahead dispatch, so the parser neither asserts nor changes acceptance.
- fpp_lsp_server: the code action and its tests next to ours.
- fpp_parser/src/error.rs: ours (the include cycle diagnostic #111 touched
  is now IncludeError::Cycle).
- fpp_python: master's nested-union generator, macros and runtime, with
  IndexSet support and our comment fixes on top; all generated files are
  regenerated with `make -C fpp_python codegen` (the stubs now live in
  python/fpp/{__init__,ast}.pyi). Tests follow the nested names and our API
  shape (19 symbol variants, TemplateArgKind and ScopeOwner unions,
  Display-based type reprs).
- Cargo.lock: master's, updated by cargo for our dependencies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Python Bindings ADT Naming

1 participant