Skip to content

refactor(semantics,solve,migrate): call source.StringValue and source.StringText directly - #1494

Merged
HuiJun merged 1 commit into
developfrom
refactor/inline-string-literal-helpers
Oct 25, 2026
Merged

HuiJun merged 1 commit into
developfrom
refactor/inline-string-literal-helpers

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

What and why

Four private one-line aliases of the source package's string-literal helpers went by the same or similar names in unrelated packages, so a grep for unquote found three different functions that all did the same thing, and the migrator called the same operation under two names:

  • internal/exec/solve/translate.go: unquote → source.StringValue (one caller)
  • internal/semantic/semantics/filter.go: unquote → source.StringValue (two callers, one in annotations.go)
  • internal/frontend/symbolfacts/attributes.go: unquote → source.StringValue (one caller)
  • internal/translate/migrate/opaque.go: stringLiteral → source.StringText (32 callers beside 6 direct source.StringText calls)

Every call site now calls source.StringValue / source.StringText directly and the wrappers are deleted. In filter.go the exported SimpleSymbolName only forwarded to an unexported simpleSymbolName with an identical doc comment; the body now lives in SimpleSymbolName and the in-package callers (filter.go, annotations.go, reflective_memberships.go) use it. No public interface, error path or output changes; the diff is 52 insertions against 73 deletions, the insertions being the source import in six migrate files.

How it was verified

Pure refactor with no behaviour change, so the existing suites are the pin:

$ gofmt -l .
$ go build ./...
$ go vet ./...
$ go test ./...
ok   (every package; five packages — cmd/sysml, internal/exec/runtime, internal/exec/smt,
      tests/codegen, tests/export — hit Go's default 10 m timeout under the parallel full run
      and passed when re-run with -timeout 60m: 332 s, 188 s, 227 s, 399 s, 197 s)
$ make lint
✓ Lint passed   (staticcheck + gosec, both modules)

Checklist

  • make test and make lint pass locally
  • Tests added or updated for the change (none: pure forwarding removal, behaviour pinned by the existing suites)
  • Documentation extended where it already covers the surface (no docs mention the removed helpers)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (no gate count moved)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/55171498f59546278b9d2753fa87c725
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/55171498f59546278b9d2753fa87c725?variant=devin
Requested by: @HuiJun

….StringText directly

Remove the private one-line aliases unquote (solve, semantics, symbolfacts)
and stringLiteral (migrate), and fold simpleSymbolName into the exported
SimpleSymbolName it forwarded to.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review October 25, 2026 04:17

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@HuiJun
HuiJun merged commit 80ec94d into develop Oct 25, 2026
53 checks passed
@HuiJun
HuiJun deleted the refactor/inline-string-literal-helpers branch October 25, 2026 07:32
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.

1 participant