1
0
forked from Mirror/wren

Regenerate REPL include.

This commit is contained in:
Bob Nystrom
2019-02-14 07:33:30 -08:00
parent 35df7faa1e
commit b2a2494008

View File

@ -73,6 +73,15 @@ static const char* replModuleSource =
" deleteLeft()\n"
" } else if (byte >= Chars.space && byte <= Chars.tilde) {\n"
" insertChar(byte)\n"
" } else if (byte == Chars.ctrlW) { // Handle Ctrl+w\n"
" // Delete trailing spaces\n"
" while (_cursor != 0 && _line[_cursor - 1] == \" \") {\n"
" deleteLeft()\n"
" }\n"
" // Delete until the next space\n"
" while (_cursor != 0 && _line[_cursor - 1] != \" \") {\n"
" deleteLeft()\n"
" }\n"
" } else {\n"
" // TODO: Other shortcuts?\n"
" System.print(\"Unhandled key-code [dec]: %(byte)\")\n"
@ -110,6 +119,14 @@ static const char* replModuleSource =
" previousHistory()\n"
" } else if (byte == EscapeBracket.down) {\n"
" nextHistory()\n"
" } else if (byte == EscapeBracket.delete) {\n"
" deleteRight()\n"
" // Consume extra 126 character generated by delete\n"
" Stdin.readByte()\n"
" } else if (byte == EscapeBracket.end) {\n"
" _cursor = _line.count\n"
" } else if (byte == EscapeBracket.home) {\n"
" _cursor = 0\n"
" }\n"
" }\n"
"\n"
@ -405,6 +422,7 @@ static const char* replModuleSource =
" static ctrlN { 0x0e }\n"
" static ctrlP { 0x10 }\n"
" static ctrlU { 0x15 }\n"
" static ctrlW { 0x17 }\n"
" static escape { 0x1b }\n"
" static space { 0x20 }\n"
" static bang { 0x21 }\n"
@ -472,10 +490,13 @@ static const char* replModuleSource =
"}\n"
"\n"
"class EscapeBracket {\n"
" static delete { 0x33 }\n"
" static up { 0x41 }\n"
" static down { 0x42 }\n"
" static right { 0x43 }\n"
" static left { 0x44 }\n"
" static end { 0x46 }\n"
" static home { 0x48 }\n"
"}\n"
"\n"
"class Token {\n"