File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -66,9 +66,7 @@ class Repl {
66
66
// TODO: Handle ESC 0 sequences.
67
67
}
68
68
} else if (byte == Chars .carriageReturn ) {
69
- var next = executeInput ()
70
- if (next == Chars .ctrlD ) return true
71
- if (next ! = null ) handleChar (next)
69
+ return executeInput ()
72
70
} else if (byte == Chars .delete ) {
73
71
deleteLeft ()
74
72
} else if (byte >= Chars .space && byte <= Chars .tilde ) {
@@ -215,13 +213,13 @@ class Repl {
215
213
}
216
214
}
217
215
218
- executeCommand (command , arguments ) {
216
+ executeCommand (command , argument ) {
219
217
if (command == Command .clear ) {
220
- return Chars .ctrlL
218
+ return this . handleChar ( Chars .ctrlL )
221
219
}
222
220
223
221
if (command == Command .exit ) {
224
- return Chars . ctrlD
222
+ return true
225
223
}
226
224
227
225
if (command == Command .help ) {
Original file line number Diff line number Diff line change @@ -68,9 +68,7 @@ static const char* replModuleSource =
68
68
" // TODO: Handle ESC 0 sequences.\n "
69
69
" }\n "
70
70
" } else if (byte == Chars.carriageReturn) {\n "
71
- " var next = executeInput()\n "
72
- " if (next == Chars.ctrlD) return true\n "
73
- " if (next != null) handleChar(next)\n "
71
+ " return executeInput()\n "
74
72
" } else if (byte == Chars.delete) {\n "
75
73
" deleteLeft()\n "
76
74
" } else if (byte >= Chars.space && byte <= Chars.tilde) {\n "
@@ -217,13 +215,13 @@ static const char* replModuleSource =
217
215
" }\n "
218
216
" }\n "
219
217
" \n "
220
- " executeCommand(command, arguments ) {\n "
218
+ " executeCommand(command, argument ) {\n "
221
219
" if (command == Command.clear) {\n "
222
- " return Chars.ctrlL\n "
220
+ " return this.handleChar( Chars.ctrlL) \n "
223
221
" }\n "
224
222
" \n "
225
223
" if (command == Command.exit) {\n "
226
- " return Chars.ctrlD \n "
224
+ " return true \n "
227
225
" }\n "
228
226
" \n "
229
227
" if (command == Command.help) {\n "
You can’t perform that action at this time.
0 commit comments