Repository navigation
Modernize to Go 1.27 and split the parser - #57
Merged
Merged
Conversation
- Bump the module and CI matrix to Go 1.27; update README badge/instructions. - Adopt current standard-library idioms across the codebase: maps.Copy, slices.Contains, slices.Clone, min(), strings.Cut, errors.AsType[*Error], and range-over-int in tests. Verified clean with gopls modernize. - Merge the duplicated size-validation helpers into a single sizeAllowed(allowed, sz) with an empty-list guard. - Split the 1.4k-line internal/asm/parser.go into focused files (parser_labels, parser_stmt, parser_macro, parser_operand, parser_ea); pure code movement, no behavior change. - gofmt the previously unformatted additional_api_test.go. Public API is unchanged. go build/vet/test (incl. e2e), benchmark compilation, and a bin/srec/elf CLI smoke test all pass. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
What changed
Go 1.27
go.modgo 1.26→go 1.271.26.x→1.27.xStandard-library modernization
Applied current idioms across the codebase (verified clean with
gopls modernize):maps.Copyinstead of manual copy loopsslices.Containsinstead of linear search loopsslices.Cloneinstead ofappend([]T(nil), s...)min()instead of if-clampstrings.Cutinstead ofIndexByte+ slicingerrors.AsType[*Error](Go 1.27) instead oferrors.Aswith a separate declarationmap[bool]stringlookup trick incanonical.goStructural
sizeAllowedinassemble.go,sizeAllowedListinparser.go) into a singlesizeAllowed(allowed, sz)with an empty-list guard.internal/asm/parser.gointo focused files — pure code movement, no behavior change:parser.go(272) — Parser type, entry points, token stream, register helpersparser_labels.go— local/global label handlingparser_stmt.go— statements, constants, instructions, paddingparser_macro.go— macro expansionparser_operand.go— form/operand/size parsingparser_ea.go— effective-address parsinggofmtthe previously unformattedadditional_api_test.go.Notes for reviewers
m68kdasmdependency mentioned in the original request was intentionally left out: it is not a dependency of this project, andm68kdasmv1.1.0 in fact depends onm68kasm.go build ./...,go vet ./...,go test ./...(incl.tests/e2e), benchmark compilation, and abin/srec/elfCLI smoke test all pass.🤖 Generated with Claude Code