Squashed commit of the following:
commit f93ec6430f9629b5a28765a3961379d1e8296e50
Author: Bob Nystrom <robert@stuffwithstuff.com>
Date: Wed Mar 16 08:03:25 2016 -0700
Tiny tweaks.
commit 332a08fe33cddffec82dbd377ee0c941a0066f64
Merge: a673981 14b7a08
Author: Bob Nystrom <robert@stuffwithstuff.com>
Date: Wed Mar 16 08:01:00 2016 -0700
Merge branch 'errorFn' of https://github.com/ppvk/wren into ppvk-errorFn
commit 14b7a086ce3dae1b12697319bc2894048fad469f
Author: Paul VanKeuren <paul.vankeuren@gmail.com>
Date: Tue Mar 15 11:33:37 2016 -0500
missing semicolon, accessing vm through parser in
commit 924eaa1f9d3fbb26dc07d3ac8be7dc00287138d9
Author: Paul VanKeuren <paul.vankeuren@gmail.com>
Date: Tue Mar 15 11:25:32 2016 -0500
fixed missing errorFn in wren.h
commit 3761df111f9dce3bd67407754675c9efbbf2c0b4
Author: Paul VanKeuren <paul.vankeuren@gmail.com>
Date: Tue Mar 15 11:23:51 2016 -0500
Added an errorFn to the CLI
commit d51137b4abe339a3f07d7e2f4c5ee0d8d062a009
Author: Paul VanKeuren <paul.vankeuren@gmail.com>
Date: Tue Mar 15 11:21:16 2016 -0500
Added a WrenErrorFn typedef, an errorFn slot in WrenConfiguration. exits early if is not defined, otherwise it runs the errorFn .
This commit is contained in:
@@ -58,6 +58,9 @@ typedef WrenForeignMethodFn (*WrenBindForeignMethodFn)(WrenVM* vm,
|
||||
// Displays a string of text to the user.
|
||||
typedef void (*WrenWriteFn)(WrenVM* vm, const char* text);
|
||||
|
||||
// Reports an error to the user.
|
||||
typedef void (*WrenErrorFn)(const char* module, int line, const char* message);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// The callback invoked when the foreign object is created.
|
||||
@@ -126,6 +129,13 @@ 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
|
||||
// number, and an error message. If this is `NULL`, Wren doesn't report any
|
||||
// errors.
|
||||
WrenErrorFn errorFn;
|
||||
|
||||
// The number of bytes Wren will allocate before triggering the first garbage
|
||||
// collection.
|
||||
|
||||
Reference in New Issue
Block a user