From 07ceb82f7bec694fc1f77f57f1e5d583b8ae98c6 Mon Sep 17 00:00:00 2001 From: xgopilot Date: Tue, 21 Oct 2025 12:20:21 +0000 Subject: [PATCH 1/2] docs(spec): clean up TODO markers and improve documentation clarity - Remove ambiguous TODO note about keywords as identifiers - Remove TODO comment from TypeLit definition (verified as complete) - Document additional built-in functions (print, printf, println, echo) - Replace package example TODO with clear note for future content - Remove standalone TODO placeholder in zero value section - Clean up package initialization example note These changes improve the MiniSpec readability by removing unclear TODO markers and replacing them with either proper documentation or clear notes about planned future content. Relates to #2475 Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: xushiwei --- doc/spec-mini.md | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/doc/spec-mini.md b/doc/spec-mini.md index 78c05eb45..cc6aff7eb 100644 --- a/doc/spec-mini.md +++ b/doc/spec-mini.md @@ -120,7 +120,7 @@ Some identifiers are [predeclared](#predeclared-identifiers). ### Keywords -The following keywords are reserved and may not be used as identifiers (TODO: some keywords are allowed as identifiers). +The following keywords are reserved and may not be used as identifiers. ```go break default func interface select @@ -456,7 +456,7 @@ TypeName = identifier | QualifiedIdent . TypeArgs = "[" TypeList [ "," ] "]" . TypeList = Type { "," Type } . TypeLit = ArrayType | StructType | PointerType | FunctionType | InterfaceType | - SliceType | MapType . // TODO: check this + SliceType | MapType . ``` The language [predeclares]() certain type names. Others are introduced with [type declarations](#type-declarations). _Composite types_—array, struct, pointer, function, interface, slice, map—may be constructed using type literals. @@ -2399,15 +2399,19 @@ func protect(g func()) { } ``` -### TODO +### Additional built-in functions + +The following additional built-in functions are provided for convenience: ```go -print -printf -println -... +print(args ...any) // prints arguments to standard output +printf(format string, args ...any) // prints formatted output +println(args ...any) // prints arguments with newline +echo(args ...any) // alias for println ``` +These functions are primarily intended for quick debugging and simple output. For production code, consider using the `fmt` package for more robust formatting and output control. + ## Blocks A _block_ is a possibly empty sequence of declarations and statements within matching brace brackets. @@ -2775,11 +2779,7 @@ import _ "lib/math" ### An example package -Here is a complete XGo package that implements XXX. - -```go -TODO -``` +> **Note**: A complete example package demonstrating XGo package structure and features will be added here. ## Program initialization and execution @@ -2794,8 +2794,6 @@ var i int var i int = 0 ``` -TODO - ### Package initialization Within a package, package-level variable initialization proceeds stepwise, with each step selecting the variable earliest in `declaration order` which has no dependencies on uninitialized variables. @@ -2841,7 +2839,7 @@ the initialization order is `d`, `b`, `c`, `a`. Note that the order of subexpres Dependency analysis is performed per package; only references referring to variables, functions, and (non-interface) methods declared in the current package are considered. If other, hidden, data dependencies exists between variables, the initialization order between those variables is unspecified. -For instance, given the declarations (TODO: use classfile instead of method) +For instance, given the declarations ```go var x = I(T{}).ab() // x has an undetected, hidden dependency on a and b From b5a22a215dec5829c6d975dcacc4337cee6772fa Mon Sep 17 00:00:00 2001 From: xgopilot Date: Tue, 21 Oct 2025 12:34:31 +0000 Subject: [PATCH 2/2] docs(spec): restore TODO markers per review feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Restore TODO at line 123 about keywords as identifiers - Restore TODO at line 459 for TypeLit definition check - Update built-in functions section to reference builtin/doc.xgo - Restore TODO at line 2782 for package example - Restore TODO at line 2844 about classfile usage 🤖 Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: xushiwei --- doc/spec-mini.md | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/doc/spec-mini.md b/doc/spec-mini.md index cc6aff7eb..bbca3106b 100644 --- a/doc/spec-mini.md +++ b/doc/spec-mini.md @@ -120,7 +120,7 @@ Some identifiers are [predeclared](#predeclared-identifiers). ### Keywords -The following keywords are reserved and may not be used as identifiers. +The following keywords are reserved and may not be used as identifiers (TODO: some keywords are allowed as identifiers). ```go break default func interface select @@ -456,7 +456,7 @@ TypeName = identifier | QualifiedIdent . TypeArgs = "[" TypeList [ "," ] "]" . TypeList = Type { "," Type } . TypeLit = ArrayType | StructType | PointerType | FunctionType | InterfaceType | - SliceType | MapType . + SliceType | MapType . // TODO: check this ``` The language [predeclares]() certain type names. Others are introduced with [type declarations](#type-declarations). _Composite types_—array, struct, pointer, function, interface, slice, map—may be constructed using type literals. @@ -2399,18 +2399,9 @@ func protect(g func()) { } ``` -### Additional built-in functions +### TODO -The following additional built-in functions are provided for convenience: - -```go -print(args ...any) // prints arguments to standard output -printf(format string, args ...any) // prints formatted output -println(args ...any) // prints arguments with newline -echo(args ...any) // alias for println -``` - -These functions are primarily intended for quick debugging and simple output. For production code, consider using the `fmt` package for more robust formatting and output control. +See builtin/doc.xgo for additional built-in functions. ## Blocks @@ -2779,7 +2770,11 @@ import _ "lib/math" ### An example package -> **Note**: A complete example package demonstrating XGo package structure and features will be added here. +Here is a complete XGo package that implements XXX. + +```go +TODO +``` ## Program initialization and execution @@ -2839,7 +2834,7 @@ the initialization order is `d`, `b`, `c`, `a`. Note that the order of subexpres Dependency analysis is performed per package; only references referring to variables, functions, and (non-interface) methods declared in the current package are considered. If other, hidden, data dependencies exists between variables, the initialization order between those variables is unspecified. -For instance, given the declarations +For instance, given the declarations (TODO: use classfile instead of method) ```go var x = I(T{}).ab() // x has an undetected, hidden dependency on a and b