dslx: parse semantic sum declarations and constructors#4457
Open
dank-openai wants to merge 1 commit into
Open
Conversation
19ce53c to
1f8ad42
Compare
dank-openai
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Jun 23, 2026
Adds Phase 1 semantic sum value representation and encoding support, including diagnostics and tests for sum type mismatch formatting.
dank-openai
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Jun 23, 2026
…uctors Adds frontend parsing, formatting, visitors, and diagnostics for semantic sum syntax while preserving typed empty numeric enum parsing until semantic-sum runtime/type support lands higher in the stack.
Adds frontend parsing, formatting, visitors, and diagnostics for semantic sum syntax while preserving typed empty numeric enum parsing until semantic-sum runtime/type support lands higher in the stack. branch:dank/upstream/semantic-sum-frontend
1f8ad42 to
cd405f4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
enumdeclarations with unit, tuple, and struct payload variants.Example
This PR makes declarations and constructors like
Option::Some(x)parse and format as semantic-sum syntax. Later changes can build typechecking and conversion semantics on top of these AST nodes.Validation
Validation ran on Ubuntu 24.04 at commit
1f8ad4299fa61d5d35d2bbd4fe4780f79314f2d8:bazel test //xls/dslx/fmt:ast_fmt_test //xls/dslx/frontend:parser_test //xls/dslx/frontend:ast_cloner_test //xls/dslx/frontend:scanner_test //xls/dslx:dslx_fmt_test //xls/dslx:constexpr_evaluator_test //xls/dslx/bytecode:bytecode_emitter_test //xls/dslx/exhaustiveness:exhaustiveness_match_test //xls/dslx/lsp:document_symbols_test //xls/dslx/translators:dslx_to_verilog_test //xls/fuzzer:value_generator_test //xls/dslx/ir_convert:ir_converter_test //xls/dslx/ir_convert:ir_converter_legacy_test //xls/dslx/tests/errors:error_modules_test //xls/dslx/run_routines:run_routines_test //xls/dslx/type_system:type_info_to_proto_test //xls/dslx/type_system_v2:typecheck_module_v2_enum_test --test_output=errors --keep_going --test_timeout=900 --cache_test_results=noMisc.
This is PR 1/7 for phase 1 implementation of sum types.