Skip to content

Commit

Permalink
Remove lookahead for open parenthesis after keywords
Browse files Browse the repository at this point in the history
I do not remember why I had added this to begin with but I don't think
it makes sense. Word boundaries will match it anyway and highlighting
keywords used as function calls seems strange.

All of the tests still pass
  • Loading branch information
ccampbell committed Jul 3, 2016
1 parent 3481cae commit ec06a86
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/language/generic.js
Expand Up @@ -38,7 +38,7 @@ Rainbow.extend('generic', [
matches: {
1: 'keyword'
},
pattern: /\b(and|array|as|b(ool(ean)?|reak)|c(ase|atch|har|lass|on(st|tinue))|d(ef|elete|o(uble)?)|e(cho|lse(if)?|xit|xtends|xcept)|f(inally|loat|or(each)?|unction)|global|if|import|int(eger)?|long|new|object|or|pr(int|ivate|otected)|public|return|self|st(ring|ruct|atic)|switch|th(en|is|row)|try|(un)?signed|var|void|while)(?=\(|\b)/gi
pattern: /\b(and|array|as|b(ool(ean)?|reak)|c(ase|atch|har|lass|on(st|tinue))|d(ef|elete|o(uble)?)|e(cho|lse(if)?|xit|xtends|xcept)|f(inally|loat|or(each)?|unction)|global|if|import|int(eger)?|long|new|object|or|pr(int|ivate|otected)|public|return|self|st(ring|ruct|atic)|switch|th(en|is|row)|try|(un)?signed|var|void|while)(?=\b)/gi
},
{
name: 'constant.language',
Expand Down
2 changes: 1 addition & 1 deletion src/language/go.js
Expand Up @@ -32,7 +32,7 @@ Rainbow.extend('go', [
matches: {
1: 'keyword'
},
pattern: /\b(break|c(ase|onst|ontinue)|d(efault|efer)|else|fallthrough|for|go(to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)(?=\(|\b)/gi
pattern: /\b(break|c(ase|onst|ontinue)|d(efault|efer)|else|fallthrough|for|go(to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)(?=\b)/gi
},
{
name: 'constant.language',
Expand Down
2 changes: 1 addition & 1 deletion src/language/lua.js
Expand Up @@ -32,7 +32,7 @@ Rainbow.extend('lua', [
matches: {
1: 'keyword'
},
pattern: /\b((a|e)nd|in|repeat|break|local|return|do|for|then|else(if)?|function|not|if|or|until|while)(?=\(|\b)/gi
pattern: /\b((a|e)nd|in|repeat|break|local|return|do|for|then|else(if)?|function|not|if|or|until|while)(?=\b)/gi
},
{
name: 'constant.language',
Expand Down
2 changes: 1 addition & 1 deletion src/language/php.js
Expand Up @@ -29,7 +29,7 @@ Rainbow.extend('php', [
},
{
name: 'keyword',
pattern: /\b(die|end(for(each)?|switch|if)|case|require(_once)?|include(_once)?)(?=\(|\b)/g
pattern: /\b(die|end(for(each)?|switch|if)|case|require(_once)?|include(_once)?)(?=\b)/g
},
{
matches: {
Expand Down
2 changes: 1 addition & 1 deletion src/language/python.js
Expand Up @@ -37,7 +37,7 @@ Rainbow.extend('python', [
matches: {
1: 'keyword'
},
pattern: /\b(pass|lambda|with|is|not|in|from|elif|raise|del)(?=\(|\b)/g
pattern: /\b(pass|lambda|with|is|not|in|from|elif|raise|del)(?=\b)/g
},
{
matches: {
Expand Down
2 changes: 1 addition & 1 deletion src/language/shell.js
Expand Up @@ -50,6 +50,6 @@ Rainbow.extend('shell', [
matches: {
1: 'keyword'
},
pattern: /\b(break|case|continue|do|done|elif|else|esac|eval|export|fi|for|function|if|in|local|return|set|then|unset|until|while)(?=\(|\b)/g
pattern: /\b(break|case|continue|do|done|elif|else|esac|eval|export|fi|for|function|if|in|local|return|set|then|unset|until|while)(?=\b)/g
}
]);

0 comments on commit ec06a86

Please sign in to comment.