Skip to content

Add Move language support (Sui, Aptos, Movement)#703

Merged
boyter merged 1 commit intoboyter:masterfrom
poelzi:add-move-language
May 4, 2026
Merged

Add Move language support (Sui, Aptos, Movement)#703
boyter merged 1 commit intoboyter:masterfrom
poelzi:add-move-language

Conversation

@poelzi
Copy link
Copy Markdown
Contributor

@poelzi poelzi commented May 2, 2026

Summary

Adds support for the Move smart-contract language, used by Sui, Aptos, Starcoin, and Movement. .move files are currently silently ignored by scc.

A single language definition covers every dialect — Move 2 (Aptos) is a lexical superset of core Move, and Sui only adds the entry modifier; no dialect renames or removes a keyword in a way that would confuse a tokenizer.

Notable choices:

  • nestedmultiline: true — Move's lexer (move-compiler/src/parser/lexer.rs) explicitly tracks nested /* /* */ */ comments via a stack, like Rust.
  • Complexity checks mirror the existing Rust entry plus match (Move 2) and abort — Move's panic primitive, used on every error path.
  • b"..." and x"..." byte/hex string prefixes work transparently because string parsing begins at the ".

Test plan

  • go generate ./... regenerates processor/constants.go with the new entry
  • go build compiles cleanly
  • go test ./... passes (including TestSpecificLanguages, which greps CSV output of examples/language/)
  • scc examples/language/move.move reports correct counts: 32 lines, 3 comments (nested block correctly counted as one region), complexity 8

Used by SUI/Aptos/Movement
@pr-insights pr-insights Bot added L/complexity Low complexity M/size Normal or medium sized change labels May 2, 2026
@boyter
Copy link
Copy Markdown
Owner

boyter commented May 4, 2026

Thanks for this. Will make the next release.

@boyter boyter merged commit 460a6e8 into boyter:master May 4, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L/complexity Low complexity M/size Normal or medium sized change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants