dslx: parse semantic sum declarations and constructors - #4457
Open
dank-openai wants to merge 1 commit into
Open
Conversation
dank-openai
force-pushed
the
dank/upstream/semantic-sum-frontend
branch
from
June 23, 2026 22:02
19ce53c to
1f8ad42
Compare
dank-openai
marked this pull request as ready for review
June 23, 2026 23:28
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.
dank-openai
force-pushed
the
dank/upstream/semantic-sum-frontend
branch
from
June 23, 2026 23:45
1f8ad42 to
cd405f4
Compare
richmckeever
requested changes
Jun 25, 2026
dank-openai
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Jul 21, 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.
dank-openai
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Jul 24, 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.
dank-openai
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Jul 25, 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.
dank-openai
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Jul 27, 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.
dank-openai
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Aug 6, 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.
dank-openai
force-pushed
the
dank/upstream/semantic-sum-frontend
branch
from
August 6, 2026 21:24
cd405f4 to
5df31da
Compare
dank-openai
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Aug 6, 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.
dank-openai
force-pushed
the
dank/upstream/semantic-sum-frontend
branch
from
August 6, 2026 23:46
5df31da to
c2d86b2
Compare
dank-openai
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Aug 7, 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.
dank-openai
force-pushed
the
dank/upstream/semantic-sum-frontend
branch
from
August 7, 2026 02:19
c2d86b2 to
22399dd
Compare
dank-openai
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Aug 7, 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.
dank-openai
force-pushed
the
dank/upstream/semantic-sum-frontend
branch
from
August 7, 2026 03:22
22399dd to
190276e
Compare
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
dank-openai
added a commit
to xlsynth/xlsynth
that referenced
this pull request
Aug 7, 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.
dank-openai
force-pushed
the
dank/upstream/semantic-sum-frontend
branch
from
August 7, 2026 19:49
190276e to
46b894a
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.