Skip to content

Commit

Permalink
Add backticks in lookbehind for if/unless and while/until modifier ru…
Browse files Browse the repository at this point in the history
…les. Add test with backticks.
  • Loading branch information
graceful-potato committed Dec 19, 2019
1 parent dbb3a75 commit c426cd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Syntaxes/Ruby.plist
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@
</dict>
<key>match</key>
<string>(?x)
(?&lt;=[}\])\w?!"'])
(?&lt;=[}\])\w?!"'`])
(?&lt;!\Wif|^if| # \WX|^X is equivalent to \bX
\Wunless|^unless| # this is workaround for code editors which doesn't support onigomo
\Wcase|^case| # https://github.com/microsoft/vscode-textmate/issues/121#issuecomment-565689295
Expand Down Expand Up @@ -682,7 +682,7 @@
<dict>
<key>match</key>
<string>(?x)
(?&lt;=[}\])\w?!"'])
(?&lt;=[}\])\w?!"'`])
(?&lt;!\Wif|^if| # \WX|^X is equivalent to \bX
\Wunless|^unless| # this is workaround for code editors which doesn't support onigomo
\Wcase|^case| # https://github.com/microsoft/vscode-textmate/issues/121#issuecomment-565689295
Expand Down
2 changes: 2 additions & 0 deletions Tests/end_distinction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ def i arg
method_without_args while false
method(with, args) while false
method with, args while false
`ls` while false

# multiline block
while i < 10
Expand Down Expand Up @@ -361,6 +362,7 @@ def i arg
method with, args if somethign
a = /regexp/ if something
"hello".scan /[eo]/ if something
`ls` if true

# singleline mix
%w(hello, world, foo).map { |e| e.scan /[oeiua]/ } * if true; 2 else 0 end
Expand Down

0 comments on commit c426cd0

Please sign in to comment.