refactor: extract character handling into separate method and add ANSI fallback support

Extract the inline character processing logic from the REPL's main loop into a dedicated `handleChar()` method that returns a boolean to indicate whether the loop should exit. Add `_allowAnsi` flag and corresponding getter/setters for cursor and line to support a simpler fallback REPL when ANSI escape sequences are unavailable.
This commit is contained in:
Bob Nystrom
2016-05-24 02:59:01 +00:00
parent 69498a4893
commit 15eb651d1f
3 changed files with 405 additions and 227 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ void metaGetModuleVariables(WrenVM* vm) {
return;
}
ObjModule* module = AS_MODULE(moduleValue);
ObjModule* module = AS_MODULE(moduleValue);
ObjList* names = wrenNewList(vm, module->variableNames.count);
vm->apiStack[0] = OBJ_VAL(names);