Skip to content

Commit

Permalink
Merge pull request #41 from farhan443/fix-regex
Browse files Browse the repository at this point in the history
fix #40: optimize Ruby's regex pattern
  • Loading branch information
Reinaldy Rafli authored Oct 3, 2021
2 parents 313def7 + 0073fa1 commit 9734330
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/languages/ruby.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const Ruby: LanguagePattern[] = [
// elsif keyword
{ pattern: /elsif/, type: 'keyword.control' },
// do
{ pattern: /(do\s*\|(\w+(,\s*\w+)?)+\|)/, type: 'keyword.control' },
{ pattern: /do\s*[|]\w+(,\s*\w+)*[|]/, type: 'keyword.control' },
// for loop
{ pattern: /for (\w+|\(?\w+,\s*\w+\)?) in (.+)/, type: 'keyword.control' },
// nil keyword
Expand Down

0 comments on commit 9734330

Please sign in to comment.