|
|
@ -84,6 +84,7 @@ function REPLServer(prompt, stream) { |
|
|
|
}); |
|
|
|
|
|
|
|
rli.addListener('line', function(cmd) { |
|
|
|
var skipCatchall = false; |
|
|
|
cmd = trimWhitespace(cmd); |
|
|
|
|
|
|
|
// Check to see if a REPL keyword was used. If it returns true,
|
|
|
@ -92,9 +93,15 @@ function REPLServer(prompt, stream) { |
|
|
|
var matches = cmd.match(/^(\.[^\s]+)\s*(.*)$/); |
|
|
|
var keyword = matches && matches[1]; |
|
|
|
var rest = matches && matches[2]; |
|
|
|
if (self.parseREPLKeyword(keyword, rest) === true) return; |
|
|
|
if (self.parseREPLKeyword(keyword, rest) === true) { |
|
|
|
return; |
|
|
|
} else { |
|
|
|
self.stream.write('Invalid REPL keyword\n'); |
|
|
|
skipCatchall = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!skipCatchall) { |
|
|
|
// The catchall for errors
|
|
|
|
try { |
|
|
|
self.buffered_cmd += cmd; |
|
|
@ -130,6 +137,7 @@ function REPLServer(prompt, stream) { |
|
|
|
} |
|
|
|
self.buffered_cmd = ''; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
self.displayPrompt(); |
|
|
|
}); |
|
|
|