Permalink
Browse files

More comments on parsing |(a, b)|

  • Loading branch information...
1 parent 05b34b6 commit 30c6aee79f739cf9d6c5f7052a376c25b695b482 @AndrewRadev AndrewRadev committed Apr 21, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 indent/ruby.vim
View
@@ -92,6 +92,14 @@ let s:continuation_regex =
let s:bracket_continuation_regex = '\%([({[]\)\s*\%(#.*\)\=$'
" Regex that defines blocks.
+"
+" Note that there's a slight problem with this regex and s:continuation_regex.
+" Code like this will be matched by both:
+"
+" method_call do |(a, b)|
+"
+" The reason is that the pipe matches a hanging "|" operator.
+"
let s:block_regex =
\ '\%(\<do:\@!\>\|{\)\s*\%(|\s*(\=\%([*@&]\=\h\w*,\=\s*\)\%(,\s*(\=\s*[*@&]\=\h\w*)\=\)*|\)\=\s*\%(#.*\)\=$'

0 comments on commit 30c6aee

Please sign in to comment.