History

new ckdoc title rendering

Ge Wang committed 3 years ago

Commit 48fbb601 parent 52ee6729 files · +59 −22Browse files

Showing the changes to src/core/ulib_std.cpp (1 of 9 files). Show all

Unified · Split

src/core/ulib_std.cpp+13−3
@@ -395,8 +395,8 @@ DLL_QUERY libstd_query( Chuck_DL_Query * QUERY ) · 394 unmodified lines
395395 #ifndef __DISABLE_PROMPTER__
396396 // begin class (Skot)
397397 if( !type_engine_import_class_begin( env, "ConsoleInput", "Event",
398− env->global(), Skot_ctor,
399− Skot_dtor ) )
398+ env->global(), Skot_ctor, Skot_dtor,
399+ "(Terminal only) a utility for prompting user input on the command line." ) )
400400 return FALSE;
401401
402402 // add member variable
@@ -405,25 +405,35 @@ DLL_QUERY libstd_query( Chuck_DL_Query * QUERY ) · 2 unmodified lines
405405
406406 // add prompt()
407407 func = make_new_mfun( "Event", "prompt", Skot_prompt );
408+ func->doc = "Return an Event to wait on.";
408409 if( !type_engine_import_mfun( env, func ) ) goto error;
409410
410411 // add prompt()
411412 func = make_new_mfun( "Event", "prompt", Skot_prompt2 );
412413 func->add_arg( "string", "what" );
414+ func->doc = "Print a prompt text and return an Event to wait on.";
413415 if( !type_engine_import_mfun( env, func ) ) goto error;
414416
415− // add ready()
417+ // add more()
416418 func = make_new_mfun( "int", "more", Skot_more );
419+ func->doc = "Return whether there is more input to read.";
417420 if( !type_engine_import_mfun( env, func ) ) goto error;
418421
419422 // add getString()
420423 func = make_new_mfun( "string", "getLine", Skot_getLine );
424+ func->doc = "Return the next line of input as a string.";
421425 if( !type_engine_import_mfun( env, func ) ) goto error;
422426
423427 // add can_wait()
424428 func = make_new_mfun( "int", "can_wait", Skot_can_wait );
429+ func->doc = "(internal) used by virtual machine for synthronization.";
425430 if( !type_engine_import_mfun( env, func ) ) goto error;
426431
432+ // add examples
433+ if( !type_engine_import_add_ex( env, "string/readline.ck" ) ) goto error;
434+ if( !type_engine_import_add_ex( env, "ai/word2vec/word2vec-prompt.ck" ) ) goto error;
435+ if( !type_engine_import_add_ex( env, "ai/word2vec/poem-ungenerate.ck" ) ) goto error;
436+
427437 // end class
428438 type_engine_import_class_end( env );
429439 #endif // __DISABLE_PROMPTER__

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t