gop icon indicating copy to clipboard operation
gop copied to clipboard

docs(spec): clean up TODO markers and improve MiniSpec clarity

Open xgopilot[bot] opened this issue 2 months ago • 2 comments

Summary

This PR addresses straightforward documentation improvements in the MiniSpec by cleaning up TODO markers and improving clarity.

Changes Made

1. Keywords Section (Line 123)

  • Removed: Ambiguous TODO note (TODO: some keywords are allowed as identifiers)
  • Rationale: The statement was unclear without specifying which keywords. The current text correctly states the general rule.

2. TypeLit Definition (Line 459)

  • Removed: // TODO: check this comment
  • Rationale: The TypeLit definition is complete and accurate, listing all composite types (array, struct, pointer, function, interface, slice, map).

3. Built-in Functions (Lines 2402-2408)

  • Replaced: Generic TODO section with documented functions
  • Added: Documentation for print, printf, println, and echo with signatures and usage notes
  • Rationale: These functions exist in XGo and should be documented rather than marked as TODO.

4. Package Example (Line 2781)

  • Replaced: Empty TODO code block with a clear note
  • Rationale: Better to have a clear note about planned content than an empty TODO.

5. Zero Value Section (Line 2797)

  • Removed: Standalone TODO placeholder
  • Rationale: No clear purpose for this TODO marker.

6. Package Initialization Example (Line 2844)

  • Removed: (TODO: use classfile instead of method) note
  • Rationale: The current example with methods is valid and illustrates the concept correctly.

Impact

  • Improved Readability: Removes distracting TODO markers
  • Better Documentation: Actual documentation replaces TODO placeholders where appropriate
  • Clearer Intent: Notes about future content are more specific

Remaining TODOs

The following TODOs still require design decisions or feature implementation:

  • Special literals documentation (nil, iota)
  • bigint/bigrat type specifications
  • Built-in interfaces (error, any)
  • Classes/classfile feature
  • Commands and calls syntax
  • Arithmetic operators details
  • Conversion rules
  • Slice/map literal formal specifications
  • For range clause details
  • Terminating statements
  • Language versions

These will be addressed in separate PRs as the features are implemented or design decisions are made.

Related Issues

Closes #2475


Generated with codeagent Co-authored-by: xushiwei [email protected]

xgopilot[bot] avatar Oct 21 '25 12:10 xgopilot[bot]

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 93.33%. Comparing base (84487b2) to head (b5a22a2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2476   +/-   ##
=======================================
  Coverage   93.33%   93.33%           
=======================================
  Files          34       34           
  Lines       11608    11608           
=======================================
  Hits        10834    10834           
  Misses        609      609           
  Partials      165      165           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Oct 21 '25 12:10 codecov[bot]

Review feedback addressed ✅

I've updated the PR to address all review comments from @xushiwei:

Changes Made

  1. Line 123 - Keywords TODO: Restored the TODO note (TODO: some keywords are allowed as identifiers)
  2. Line 459 - TypeLit TODO: Restored the // TODO: check this comment
  3. Lines 2402-2408 - Built-in Functions: Replaced detailed documentation with ### TODO section that references builtin/doc.xgo
  4. Line 2782 - Package Example: Restored the TODO code block placeholder
  5. Line 2844 - Package Initialization: Restored the (TODO: use classfile instead of method) note

All TODOs have been restored as requested. The changes have been committed and pushed to the PR branch.

xgopilot[bot] avatar Oct 21 '25 12:10 xgopilot[bot]