Changed the typeRe regular expression to be more strict.

This commit is contained in:
dgeorge 2011-11-11 09:24:08 -08:00
commit a4e1ab55f0

View file

@ -82,8 +82,8 @@ function BracketMatch() {
// matches any token containing the same identifiers or a subset. In
// addition, if token.type includes "rparen", then also match "lparen".
// So if type.token is "paren.rparen", then typeRe will match "lparen.paren".
var typeRe = new RegExp("(\\.?[" +
token.type.replace(".", "|").replace("rparen", "lparen|rparen") + "])+");
var typeRe = new RegExp("(\\.?" +
token.type.replace(".", "|").replace("rparen", "lparen|rparen") + ")+");
// Start searching in token, just before the character at position.column
var valueIndex = position.column - iterator.getCurrentTokenColumn() - 2;
@ -135,8 +135,8 @@ function BracketMatch() {
// matches any token containing the same identifiers or a subset. In
// addition, if token.type includes "lparen", then also match "rparen".
// So if type.token is "lparen.paren", then typeRe will match "paren.rparen".
var typeRe = new RegExp("(\\.?[" +
token.type.replace(".", "|").replace("lparen", "lparen|rparen") + "])+");
var typeRe = new RegExp("(\\.?" +
token.type.replace(".", "|").replace("lparen", "lparen|rparen") + ")+");
// Start searching in token, after the character at position.column
var valueIndex = position.column - iterator.getCurrentTokenColumn();