docs: replace placeholder TODO with full VM configuration documentation and fix typo in wren.h

Replace the stub "TODO: Write these docs." in configuring-the-vm.markdown with comprehensive documentation covering all WrenConfiguration fields including binding callbacks, memory management, and error handling. Also fix the typo "phyisically" to "physically" in the wren.h header comment and remove trailing whitespace on several lines.
This commit is contained in:
Bob Nystrom
2017-02-12 19:04:38 +00:00
parent 63f46adf06
commit ecf3b7081b
2 changed files with 194 additions and 9 deletions
+6 -6
View File
@@ -76,10 +76,10 @@ typedef enum
{
// A syntax or resolution error detected at compile time.
WREN_ERROR_COMPILE,
// The error message for a runtime error.
WREN_ERROR_RUNTIME,
// One entry of a runtime error's stack trace.
WREN_ERROR_STACK_TRACE
} WrenErrorType;
@@ -128,7 +128,7 @@ typedef struct
// The callback Wren uses to load a module.
//
// Since Wren does not talk directly to the file system, it relies on the
// embedder to phyisically locate and read the source code for a module. The
// embedder to physically locate and read the source code for a module. The
// first time an import appears, Wren will call this and pass in the name of
// the module being imported. The VM should return the soure code for that
// module. Memory for the source should be allocated using [reallocateFn] and
@@ -166,7 +166,7 @@ typedef struct
//
// If this is `NULL`, Wren discards any printed text.
WrenWriteFn writeFn;
// The callback Wren uses to report errors.
//
// When an error occurs, this will be called with the module name, line
@@ -198,7 +198,7 @@ typedef struct
// percentage of the current heap size.
//
// For example, say that this is 50. After a garbage collection, when there
// are 400 bytes of memory still in use, the next collection will be triggered
// are 400 bytes of memory still in use, the next collection will be triggered
// after a total of 600 bytes are allocated (including the 400 already in use.)
//
// Setting this to a smaller number wastes less memory, but triggers more
@@ -227,7 +227,7 @@ typedef enum
WREN_TYPE_LIST,
WREN_TYPE_NULL,
WREN_TYPE_STRING,
// The object is of a type that isn't accessible by the C API.
WREN_TYPE_UNKNOWN
} WrenType;