PageRenderTime 51ms CodeModel.GetById 30ms app.highlight 1ms RepoModel.GetById 19ms app.codeStats 0ms

/ruby-mode/Arrays/Array.new(10) { |i| .. } (Arr).yasnippet

http://github.com/ridgetang/snippets
Unknown | 6 lines | 6 code | 0 blank | 0 comment | 0 complexity | 1cb5f4dff268435dba3850cd671d8ffe MD5 | raw file
1# -*- mode: snippet -*-
2# key: Array
3# contributor: Translated from TextMate Snippet
4# name: Array.new(10) { |i| .. }
5# --
6Array.new(${1:10}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:i}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 }