0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 15:30:56 +01:00

add $ to variable name character matching patterns in repl completer

This commit is contained in:
Sean Coates 2010-10-09 12:25:02 -04:00 committed by Ryan Dahl
parent 634c4bf0b0
commit ae87007478

View File

@ -266,8 +266,8 @@ REPLServer.prototype.complete = function (line) {
// spam.eggs.<|> # completions for 'spam.eggs' with filter ''
// foo<|> # all scope vars with filter 'foo'
// foo.<|> # completions for 'foo' with filter ''
else if (line.length === 0 || line[line.length-1].match(/\w|\./)) {
var simpleExpressionPat = /(([a-zA-Z_]\w*)\.)*([a-zA-Z_]\w*)\.?$/;
else if (line.length === 0 || line[line.length-1].match(/\w|\.|\$/)) {
var simpleExpressionPat = /(([a-zA-Z_$](?:\w|\$)*)\.)*([a-zA-Z_$](?:\w|\$)*)\.?$/;
match = simpleExpressionPat.exec(line);
if (line.length === 0 || match) {
var expr;