refactor: clarify argument descriptions in RunFile and RunString comments

Rewrote the function comments for RunFile and RunString to improve clarity
and stability under `go fmt`. The previous indentation-based formatting was
not preserved by `go fmt`, so the description style was revised to use
distinct bullet points for each argument.
This commit is contained in:
HAYAMA_Kaoru
2025-05-03 18:51:09 +09:00
parent 3a4fa09e5a
commit a970501d54
+11 -9
View File
@@ -8,10 +8,11 @@ import (
)
// RunFile loads and executes a Lisp script from the specified file.
// - fname: the path to the Lisp source file to be executed.
// - args: typically corresponds to os.Args[1:], where:
// - args[0] is the script file name (not used directly),
// - args[1:] are the arguments passed to the script.
//
// - fname: the path to the Lisp source file to be executed.
// - args: typically corresponds to os.Args[1:].
// - args[0]: the script file name (not used directly).
// - args[1:]: arguments passed to the script.
func RunFile(fname string, args []string) error {
script, err := os.ReadFile(fname)
if err != nil {
@@ -20,11 +21,12 @@ func RunFile(fname string, args []string) error {
return RunString(string(script), args)
}
// RunString executes a Lisp script provided as a string.
// - script: the Lisp code to be executed.
// - args: typically corresponds to os.Args[1:], where:
// - args[0] is a pseudo script name,
// - args[1:] are the arguments passed to the script.
// RunString executes a Lisp script given directly as a string.
//
// - script: the Lisp source code to be executed (equivalent to the contents of a file).
// - args: typically corresponds to os.Args[1:].
// - args[0]: the script file name (not used directly).
// - args[1:]: arguments passed to the script.
func RunString(script string, args []string) error {
term, err := NewTerm()
if err != nil {