Skip to content

Instantly share code, notes, and snippets.

@kana
Created February 22, 2012 16:09
Show Gist options
  • Save kana/1885802 to your computer and use it in GitHub Desktop.
Save kana/1885802 to your computer and use it in GitHub Desktop.
vim-smartpunc profiling result
SCRIPT /Users/kana/working/vim-smartpunc/plugin/smartpunc.vim
Sourced 1 time
Total time: 3.099673
Self time: 0.000369
count total (s) self (s)
" smartpunc - Smart input assistant for punctuations
" Version: 0.0.0
" Copyright (C) 2012 Kana Natsuno <http://whileimautomaton.net/>
" License: So-called MIT/X license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
1 0.000065 if exists('g:loaded_smartpunc')
finish
endif
1 0.000045 function! s:set_up_the_default_configuration()
call smartpunc#define_default_rules()
if !exists('g:smartpunc_no_default_key_mappings')
let all_chars = map(copy(smartpunc#scope().available_nrules), 'v:val.char')
let d = {}
for char in all_chars
let d[char] = char
endfor
let unique_chars = keys(d)
let M = function('smartpunc#map_to_trigger')
for char in unique_chars
" Do not override existing key mappings.
silent! call M('<unique> ' . char, char, char)
endfor
silent! call M('<unique> <C-h>', '<BS>', '<C-h>')
silent! call M('<unique> <Return>', '<Enter>', '<Return>')
silent! call M('<unique> <C-m>', '<Enter>', '<C-m>')
silent! call M('<unique> <CR>', '<Enter>', '<CR>')
silent! call M('<unique> <C-j>', '<Enter>', '<C-j>')
silent! call M('<unique> <NL>', '<Enter>', '<NL>')
endif
endfunction
1 0.000207 call s:set_up_the_default_configuration()
1 0.000005 let g:loaded_smartpunc = 1
" __END__
" vim: foldmethod=marker
SCRIPT /Users/kana/working/vim-smartpunc/autoload/smartpunc.vim
Sourced 1 time
Total time: 0.001680
Self time: 0.001680
count total (s) self (s)
" smartpunc - Smart input assistant for punctuations
" Version: 0.0.0
" Copyright (C) 2012 Kana Natsuno <http://whileimautomaton.net/>
" License: So-called MIT/X license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
" Naming guidelines "{{{1
" Rules "{{{2
"
" "urule" stands for "Unnormalized RULE".
" urules are rules written by users.
" Optional items may be omitted from urules.
"
" "nrule" stands for "Normalized RULE".
" nrules are rules completed with all optional items and internal items.
"
" "snrule" stands for "SemiNormalized RULE".
" snrules are mostly same as nrules, the only one difference is that
" "priority" items may be omitted from snrules.
" Variables "{{{1
1 0.000019 let s:available_nrules = [] "{{{2
" :: [NRule] -- sorted by priority in descending order.
"{{{2
" Interface "{{{1
1 0.000005 function! smartpunc#clear_rules() "{{{2
let s:available_nrules = []
endfunction
1 0.000005 function! smartpunc#define_default_rules() "{{{2
let urules = {}
let urules.names = []
let urules.table = {}
function! urules.add(name, urules)
call add(self.names, a:name)
let self.table[a:name] = a:urules
endfunction
" Other rules "{{{
call urules.add('()', [
\ {'at': '\%#', 'char': '(', 'input': '()<Left>'},
\ {'at': '(\%#)', 'char': ')', 'input': '<Right>'},
\ {'at': '(\%#)', 'char': '<BS>', 'input': '<BS><Del>'},
\ {'at': '\\\%#', 'char': '(', 'input': '('},
\ ])
call urules.add('[]', [
\ {'at': '\%#', 'char': '[', 'input': '[]<Left>'},
\ {'at': '\[\%#\]', 'char': ']', 'input': '<Right>'},
\ {'at': '\[\%#\]', 'char': '<BS>', 'input': '<BS><Del>'},
\ {'at': '\\\%#', 'char': '[', 'input': '['},
\ ])
call urules.add('{}', [
\ {'at': '\%#', 'char': '{', 'input': '{}<Left>'},
\ {'at': '{\%#}', 'char': '}', 'input': '<Right>'},
\ {'at': '{\%#}', 'char': '<BS>', 'input': '<BS><Del>'},
\ {'at': '\\\%#', 'char': '{', 'input': '{'},
\ ])
call urules.add('<>', [
\ {'at': '\%#', 'char': '<LT>', 'input': '<LT>><Left>'},
\ {'at': '<\%#>', 'char': '>', 'input': '<Right>'},
\ {'at': '<\%#>', 'char': '<BS>', 'input': '<BS><Del>'},
\ {'at': '\\\%#', 'char': '<LT>', 'input': '<LT>'},
\ ])
call urules.add('''''', [
\ {'at': '\%#', 'char': '''', 'input': '''''<Left>'},
\ {'at': '''\%#''', 'char': '''', 'input': '<Right>'},
\ {'at': '''\%#''', 'char': '<BS>', 'input': '<BS><Del>'},
\ {'at': '\\\%#', 'char': '''', 'input': ''''},
\ ])
call urules.add('""', [
\ {'at': '\%#', 'char': '"', 'input': '""<Left>'},
\ {'at': '"\%#"', 'char': '"', 'input': '<Right>'},
\ {'at': '"\%#"', 'char': '<BS>', 'input': '<BS><Del>'},
\ {'at': '\\\%#', 'char': '"', 'input': '"'},
\ ])
call urules.add('``', [
\ {'at': '\%#', 'char': '`', 'input': '``<Left>'},
\ {'at': '`\%#`', 'char': '`', 'input': '<Right>'},
\ {'at': '`\%#`', 'char': '<BS>', 'input': '<BS><Del>'},
\ {'at': '\\\%#', 'char': '`', 'input': '`'},
\ ])
call urules.add('English', [
\ {'at': '\w\%#', 'char': '''', 'input': ''''},
\ ])
call urules.add('Lisp quote', [
\ {'at': '\%#', 'char': '''', 'input': ''''},
\ {'at': '\%#', 'char': '''', 'input': '''''<Left>',
\ 'syntax': ['Constant']},
\ ])
" FIXME: Add more rules like '(<Enter>)'
call urules.add('(<Enter>)', [
\ {'at': '(\%#)', 'char': '<Enter>', 'input': '<Enter>X<Enter>)<BS><Up><C-o>$<BS>'},
\ ])
call urules.add('case:', [
\ {'at': '\C\<case\>.*\%#', 'char': ':', 'input': ':'},
\ ])
call urules.add('default:', [
\ {'at': '\C\<default\>.*\%#', 'char': ':', 'input': ':'},
\ ])
call urules.add('x.y', [])
call urules.add('f(x)', [])
call urules.add('a[x]', [])
call urules.add('new', [])
call urules.add('typeof', [])
call urules.add('checked', [])
call urules.add('unchecked', [])
call urules.add('default(T)', [])
call urules.add('delegate', [])
call urules.add('+ (unary)', [])
call urules.add('- (unary)', [])
call urules.add('!', [])
call urules.add('~', [])
call urules.add('(T)x', [])
call urules.add('true', [])
call urules.add('false', [])
call urules.add('& (dereference)', [])
call urules.add('sizeof', [])
call urules.add('is', [])
call urules.add('as', [])
call urules.add('T<T>', [
\ {'at': '\V\V < \%#', 'char': '>', 'input': '<BS><BS><BS><LT>><Left>'},
\ {'at': '<\%#>', 'char': '<BS>', 'input': '<BS><Del>'},
\ ])
call urules.add('// comment', [
\ {'at': '\V\V / \%#', 'char': '/', 'input': '<BS><BS><BS>// '},
\ {'at': '// \%#', 'char': '<BS>', 'input': '<BS><BS><BS> / '},
\ ])
call urules.add('/// comment', [
\ {'at': '\V\V// \%#', 'char': '/', 'input': '<BS><BS><BS>/// '},
\ {'at': '/// \%#', 'char': '<BS>', 'input': '<BS><BS><BS><BS>// '},
\ ])
call urules.add('/* comment */', [
\ {'at': '\V\V / \%#', 'char': '*', 'input': '<BS><BS><BS>/* */<Left><Left><Left>'},
\ {'at': '/\* \%# \*/', 'char': '<BS>', 'input': '<BS><BS><BS><Del><Del><Del> / '},
\ ])
"}}}
" Single-character operator rules "{{{
for operator_name in [
\ '=',
\ '+',
\ '-',
\ '*',
\ '/',
\ '%',
\ '<',
\ '>',
\ '|',
\ '&',
\ '^',
\ '?',
\ ':',
\ ]
let rule_set_name = operator_name
let k = s:_operator_key_from(operator_name)
let p = s:_operator_pattern_from(operator_name)
let bs3 = repeat('<BS>', 3)
call urules.add(rule_set_name, [
\ {'at': '\%#', 'char': k, 'input': ' '.k.' '},
\ {'at': '\V '.p.' \%#', 'char': '<BS>', 'input': bs3},
\ {'at': '\S \%#', 'char': k, 'input': k.' '},
\ {'at': '\V '.p.' \%#', 'char': '<Space>', 'input': ''},
\ ])
endfor
"}}}
" Double-character operator rules (normal) "{{{
for operator_name in [
\ '==',
\ '=>',
\ '=~',
\ '+=',
\ '-=',
\ '*=',
\ '/=',
\ '%=',
\ '<=',
\ '<<',
\ '>=',
\ '>>',
\ '|=',
\ '||',
\ '&=',
\ '&&',
\ '^=',
\ '??',
\ ]
let rule_set_name = operator_name
let kt = s:_operator_key_from(operator_name[1])
let k1 = s:_operator_key_from(operator_name[0])
let k2 = s:_operator_key_from(operator_name)
let p1 = s:_operator_pattern_from(operator_name[0])
let p2 = s:_operator_pattern_from(operator_name)
let bs3 = repeat('<BS>', 3)
let bs4 = repeat('<BS>', 4)
call urules.add(rule_set_name, [
\ {'at': '\V '.p1.' \%#', 'char': kt, 'input': bs3.' '.k2.' '},
\ {'at': '\V '.p2.' \%#', 'char': '<BS>', 'input': bs4.' '.k1.' '},
\ {'at': '\V '.p2.' \%#', 'char': '<Space>', 'input': ''},
\ ])
endfor
"}}}
" Double-character operator rules (!=, etc) "{{{
for operator_name in [
\ '!=',
\ '!~',
\ ]
let rule_set_name = operator_name
let kt = s:_operator_key_from(operator_name[1])
let k1 = s:_operator_key_from(operator_name[0])
let k2 = s:_operator_key_from(operator_name)
let p1 = s:_operator_pattern_from(operator_name[0])
let p2 = s:_operator_pattern_from(operator_name)
let bs1 = repeat('<BS>', 1)
let bs4 = repeat('<BS>', 4)
call urules.add(rule_set_name, [
\ {'at': '\V'.p1.'\%#', 'char': kt, 'input': bs1.' '.k2.' '},
\ {'at': '\V '.p2.' \%#', 'char': '<BS>', 'input': bs4.k1},
\ {'at': '\V '.p2.' \%#', 'char': '<Space>', 'input': ''},
\ ])
endfor
"}}}
" Double-character operator rules (++, etc) "{{{
for operator_name in [
\ '++',
\ '--',
\ '->',
\ ]
let rule_set_name = operator_name
let kt = s:_operator_key_from(operator_name[1])
let k1 = s:_operator_key_from(operator_name[0])
let k2 = s:_operator_key_from(operator_name)
let p1 = s:_operator_pattern_from(operator_name[0])
let p2 = s:_operator_pattern_from(operator_name)
let bs2 = repeat('<BS>', 2)
let bs3 = repeat('<BS>', 3)
call urules.add(rule_set_name, [
\ {'at': '\V '.p1.' \%#', 'char': kt, 'input': bs3.k2},
\ {'at': '\V'.p2.'\%#', 'char': '<BS>', 'input': bs2.' '.k1.' '},
\ ])
endfor
"}}}
" Triple-character operator rules "{{{
for operator_name in [
\ '===',
\ '!==',
\ '<=>',
\ '<<=',
\ '>>=',
\ ]
let rule_set_name = operator_name
let kt = s:_operator_key_from(operator_name[2])
let k2 = s:_operator_key_from(operator_name[:1])
let k3 = s:_operator_key_from(operator_name)
let p2 = s:_operator_pattern_from(operator_name[:1])
let p3 = s:_operator_pattern_from(operator_name)
let bs4 = repeat('<BS>', 4)
let bs5 = repeat('<BS>', 5)
call urules.add(rule_set_name, [
\ {'at': '\V '.p2.' \%#', 'char': kt, 'input': bs4.' '.k3.' '},
\ {'at': '\V '.p3.' \%#', 'char': '<BS>', 'input': bs5.' '.k2.' '},
\ {'at': '\V '.p3.' \%#', 'char': '<Space>', 'input': ''},
\ ])
endfor
"}}}
" ft_urule_sets_table... "{{{
let ft_urule_sets_table = {
\ '*': [
\ urules.table['()'],
\ urules.table['[]'],
\ urules.table['{}'],
\ urules.table['<>'],
\ urules.table[''''''],
\ urules.table['""'],
\ urules.table['``'],
\ urules.table['English'],
\ urules.table['(<Enter>)'],
\ ],
\ 'cs': [
\ urules.table['x.y'],
\ urules.table['f(x)'],
\ urules.table['a[x]'],
\ urules.table['++'],
\ urules.table['--'],
\ urules.table['new'],
\ urules.table['typeof'],
\ urules.table['checked'],
\ urules.table['unchecked'],
\ urules.table['default(T)'],
\ urules.table['delegate'],
\ urules.table['->'],
\
\ urules.table['+ (unary)'],
\ urules.table['- (unary)'],
\ urules.table['!'],
\ urules.table['~'],
\ urules.table['(T)x'],
\ urules.table['true'],
\ urules.table['false'],
\ urules.table['& (dereference)'],
\ urules.table['sizeof'],
\
\ urules.table['*'],
\ urules.table['/'],
\ urules.table['%'],
\
\ urules.table['+'],
\ urules.table['-'],
\
\ urules.table['<<'],
\ urules.table['>>'],
\
\ urules.table['<'],
\ urules.table['>'],
\ urules.table['<='],
\ urules.table['>='],
\ urules.table['is'],
\ urules.table['as'],
\ urules.table['=='],
\ urules.table['!='],
\
\ urules.table['&'],
\ urules.table['^'],
\ urules.table['|'],
\
\ urules.table['&&'],
\ urules.table['||'],
\
\ urules.table['??'],
\ urules.table['?'],
\ urules.table[':'],
\ urules.table['case:'],
\ urules.table['default:'],
\
\ urules.table['='],
\ urules.table['+='],
\ urules.table['-='],
\ urules.table['*='],
\ urules.table['/='],
\ urules.table['%='],
\ urules.table['&='],
\ urules.table['|='],
\ urules.table['^='],
\ urules.table['<<='],
\ urules.table['>>='],
\
\ urules.table['=>'],
\
\ urules.table['T<T>'],
\ urules.table['// comment'],
\ urules.table['/// comment'],
\ urules.table['/* comment */'],
\ ],
\ 'javascript': [
\ urules.table['='],
\ urules.table['=='],
\ urules.table['==='],
\ urules.table['!='],
\ urules.table['!=='],
\ ],
\ 'lisp': [
\ urules.table['Lisp quote'],
\ ],
\ 'ruby': [
\ urules.table['<'],
\ urules.table['<='],
\ urules.table['<=>'],
\ ],
\ 'scheme': [
\ urules.table['Lisp quote'],
\ ],
\ 'vim': [
\ urules.table['='],
\ urules.table['=~'],
\ urules.table['!~'],
\ ],
\ }
"}}}
for urule_set in ft_urule_sets_table['*']
for urule in urule_set
call smartpunc#define_rule(urule)
endfor
endfor
let overlaied_urules = {}
let overlaied_urules.pairs = [] " [(URule, [FileType])]
function! overlaied_urules.add(urule, ft)
for [urule, fts] in self.pairs
if urule is a:urule
call add(fts, a:ft)
return
endif
endfor
call add(self.pairs, [a:urule, [a:ft]])
endfunction
for ft in filter(keys(ft_urule_sets_table), 'v:val != "*"')
for urule_set in ft_urule_sets_table[ft]
for urule in urule_set
call overlaied_urules.add(urule, ft)
endfor
endfor
endfor
for [urule, fts] in overlaied_urules.pairs
let completed_urule = copy(urule)
let completed_urule.filetype = fts
call smartpunc#define_rule(completed_urule)
endfor
" Add more useful rules?
endfunction
1 0.000006 function! s:_operator_key_from(operator_name)
let k = a:operator_name
let k = substitute(k, '\V<', '<LT>', 'g')
let k = substitute(k, '\V|', '<Bar>', 'g')
return k
endfunction
1 0.000005 function! s:_operator_pattern_from(operator_name)
let k = a:operator_name
return k
endfunction
1 0.000005 function! smartpunc#define_rule(urule) "{{{2
let nrule = s:normalize_rule(a:urule)
call s:remove_a_same_rule(s:available_nrules, nrule)
call add(s:available_nrules, nrule)
call
\ map(
\ reverse(
\ sort(
\ map(
\ s:available_nrules,
\ '[printf("%06d:%s", v:val.priority, v:val.at), v:val]'
\ )
\ )
\ ),
\ 'v:val[1]'
\ )
endfunction
1 0.000004 function! s:nrule_comparer_desc(nrule1, nrule2)
let c = a:nrule2.priority - a:nrule1.priority
if c != 0
return c
endif
let c = a:nrule2.at <# a:nrule1.at
if c != 0
return -1
endif
return a:nrule2.at ==# a:nrule1.at ? 0 : 1
endfunction
1 0.000006 function! smartpunc#map_to_trigger(lhs, rhs_char, rhs_fallback) "{{{2
" According to :help 'autoindent' --
"
" > Copy indent from current line when starting a new line
" > (typing <CR> in Insert mode or when using the "o" or "O" command).
" > If you do not type anything on the new line except <BS> or CTRL-D
" > and then type <Esc>, CTRL-O or <CR>, the indent is deleted again.
"
" So that a:rhs_fallback MUST be mapped from a:lhs without leaving from
" Insert mode to keep the behavior on automatic indentation when
" a:rhs_fallback == '<Enter>',
let char_expr = s:_encode_for_map_char_expr(a:rhs_char)
let fallback_expr = s:_encode_for_map_char_expr(a:rhs_fallback)
execute printf('inoremap %s %s <SID>_trigger_or_fallback(%s, %s)',
\ '<script> <expr> <silent>',
\ a:lhs,
\ char_expr,
\ fallback_expr)
endfunction
1 0.000006 function! s:_encode_for_map_char_expr(rhs_char)
let s = a:rhs_char
let s = substitute(s, '<', '<Bslash><LT>', 'g')
let s = escape(s, '"')
let s = '"' . s . '"'
return s
endfunction
1 0.000004 function! s:_trigger_or_fallback(char, fallback)
let nrule = s:find_the_most_proper_rule(s:available_nrules, a:char)
if nrule is 0
return a:fallback
else
return nrule._input
endif
endfunction
"{{{2
" Misc. "{{{1
1 0.000004 function! smartpunc#scope() "{{{2
return s:
endfunction
1 0.000004 function! smartpunc#sid() "{{{2
return maparg('<SID>', 'n')
endfunction
1 0.000016 nnoremap <SID> <SID>
1 0.000005 function! s:are_same_rules(nrule1, nrule2) "{{{2
for key in filter(keys(a:nrule1), 'v:val !=# "input" && v:val !=# "_input"')
if type(a:nrule1[key]) !=# type(a:nrule2[key])
\ || a:nrule1[key] !=# a:nrule2[key]
return !!0
endif
endfor
return !0
endfunction
1 0.000005 function! s:calculate_rule_priority(snrule) "{{{2
return
\ len(a:snrule.at)
\ + (a:snrule.filetype is 0 ? 0 : 100 / len(a:snrule.filetype))
\ + (a:snrule.syntax is 0 ? 0 : 100 / len(a:snrule.syntax))
endfunction
1 0.000005 function! s:decode_key_notation(s) "{{{2
return eval('"' . escape(a:s, '<"\') . '"')
endfunction
1 0.000004 function! s:find_the_most_proper_rule(nrules, char) "{{{2
" FIXME: Optimize for speed if necessary.
let syntax_names = map(synstack(line('.'), col('.')),
\ 'synIDattr(synIDtrans(v:val), "name")')
for nrule in a:nrules
if !(a:char ==# nrule._char)
continue
endif
if !(search(nrule.at, 'bcnW'))
continue
endif
if !(nrule.filetype is 0
\ ? !0
\ : 0 <= index(nrule.filetype, &l:filetype))
continue
endif
if !(nrule.syntax is 0
\ ? !0
\ : 0 <= max(map(copy(nrule.syntax), 'index(syntax_names, v:val)')))
continue
endif
return nrule
endfor
return 0
endfunction
1 0.000006 function! s:normalize_rule(urule) "{{{2
let nrule = deepcopy(a:urule)
let nrule._char = s:decode_key_notation(nrule.char)
let nrule._input = s:decode_key_notation(nrule.input)
if has_key(nrule, 'filetype')
call sort(nrule.filetype)
else
let nrule.filetype = 0
endif
if has_key(nrule, 'syntax')
call sort(nrule.syntax)
else
let nrule.syntax = 0
endif
let nrule.priority = s:calculate_rule_priority(nrule)
return nrule
endfunction
1 0.000005 function! s:remove_a_same_rule(nrules, nrule) "{{{2
for i in range(len(a:nrules))
if s:are_same_rules(a:nrule, a:nrules[i])
call remove(a:nrules, i)
return
endif
endfor
endfunction
1 0.000004 function! s:sid_value() "{{{2
return substitute(smartpunc#sid(), '<SNR>', "\<SNR>", 'g')
endfunction
"{{{2
" __END__ "{{{1
" vim: foldmethod=marker
FUNCTION <SNR>2_find_the_most_proper_rule()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
" FIXME: Optimize for speed if necessary.
let syntax_names = map(synstack(line('.'), col('.')), 'synIDattr(synIDtrans(v:val), "name")')
for nrule in a:nrules
if !(a:char ==# nrule._char)
continue
endif
if !(search(nrule.at, 'bcnW'))
continue
endif
if !(nrule.filetype is 0 ? !0 : 0 <= index(nrule.filetype, &l:filetype))
continue
endif
if !(nrule.syntax is 0 ? !0 : 0 <= max(map(copy(nrule.syntax), 'index(syntax_names, v:val)')))
continue
endif
return nrule
endfor
return 0
FUNCTION <SNR>1_set_up_the_default_configuration()
Called 1 time
Total time: 3.099303
Self time: 0.003088
count total (s) self (s)
1 3.093016 0.000871 call smartpunc#define_default_rules()
1 0.000010 if !exists('g:smartpunc_no_default_key_mappings')
1 0.000202 0.000198 let all_chars = map(copy(smartpunc#scope().available_nrules), 'v:val.char')
1 0.000004 let d = {}
176 0.000312 for char in all_chars
175 0.000631 let d[char] = char
175 0.000267 endfor
1 0.000013 let unique_chars = keys(d)
1 0.000007 let M = function('smartpunc#map_to_trigger')
27 0.000064 for char in unique_chars
" Do not override existing key mappings.
26 0.003665 0.000435 silent! call M('<unique> ' . char, char, char)
26 0.000069 endfor
1 0.000143 0.000010 silent! call M('<unique> <C-h>', '<BS>', '<C-h>')
1 0.000161 0.000010 silent! call M('<unique> <Return>', '<Enter>', '<Return>')
1 0.000147 0.000010 silent! call M('<unique> <C-m>', '<Enter>', '<C-m>')
1 0.000145 0.000010 silent! call M('<unique> <CR>', '<Enter>', '<CR>')
1 0.000143 0.000010 silent! call M('<unique> <C-j>', '<Enter>', '<C-j>')
1 0.000156 0.000009 silent! call M('<unique> <NL>', '<Enter>', '<NL>')
1 0.000002 endif
FUNCTION <SNR>2__operator_pattern_from()
Called 69 times
Total time: 0.000496
Self time: 0.000496
count total (s) self (s)
69 0.000262 let k = a:operator_name
69 0.000146 return k
FUNCTION <SNR>2_nrule_comparer_desc()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
let c = a:nrule2.priority - a:nrule1.priority
if c != 0
return c
endif
let c = a:nrule2.at <# a:nrule1.at
if c != 0
return -1
endif
return a:nrule2.at ==# a:nrule1.at ? 0 : 1
FUNCTION smartpunc#scope()
Called 1 time
Total time: 0.000004
Self time: 0.000004
count total (s) self (s)
1 0.000003 return s:
FUNCTION <SNR>2__operator_key_from()
Called 97 times
Total time: 0.002367
Self time: 0.002367
count total (s) self (s)
97 0.000378 let k = a:operator_name
97 0.000822 let k = substitute(k, '\V<', '<LT>', 'g')
97 0.000736 let k = substitute(k, '\V|', '<Bar>', 'g')
97 0.000224 return k
FUNCTION <SNR>2_are_same_rules()
Called 15225 times
Total time: 0.897651
Self time: 0.897651
count total (s) self (s)
19785 0.524238 for key in filter(keys(a:nrule1), 'v:val !=# "input" && v:val !=# "_input"')
19785 0.232284 if type(a:nrule1[key]) !=# type(a:nrule2[key]) || a:nrule1[key] !=# a:nrule2[key]
15225 0.031052 return !!0
endif
4560 0.006946 endfor
return !0
FUNCTION smartpunc#define_default_rules()
Called 1 time
Total time: 3.090452
Self time: 0.013711
count total (s) self (s)
1 0.000006 let urules = {}
1 0.000005 let urules.names = []
1 0.000004 let urules.table = {}
1 0.000003 function! urules.add(name, urules)
call add(self.names, a:name)
let self.table[a:name] = a:urules
endfunction
" Other rules "{{{
1 0.000062 0.000038 call urules.add('()', [ {'at': '\%#', 'char': '(', 'input': '()<Left>'}, {'at': '(\%#)', 'char': ')', 'input': '<Right>'}, {'at': '(\%#)', 'char': '<BS>', 'input': '<BS><Del>'}, {'at': '\\\%#', 'char': '(', 'input': '('}, ])
1 0.000034 0.000021 call urules.add('[]', [ {'at': '\%#', 'char': '[', 'input': '[]<Left>'}, {'at': '\[\%#\]', 'char': ']', 'input': '<Right>'}, {'at': '\[\%#\]', 'char': '<BS>', 'input': '<BS><Del>'}, {'at': '\\\%#', 'char': '[', 'input': '['}, ])
1 0.000032 0.000020 call urules.add('{}', [ {'at': '\%#', 'char': '{', 'input': '{}<Left>'}, {'at': '{\%#}', 'char': '}', 'input': '<Right>'}, {'at': '{\%#}', 'char': '<BS>', 'input': '<BS><Del>'}, {'at': '\\\%#', 'char': '{', 'input': '{'}, ])
1 0.000035 0.000023 call urules.add('<>', [ {'at': '\%#', 'char': '<LT>', 'input': '<LT>><Left>'}, {'at': '<\%#>', 'char': '>', 'input': '<Right>'}, {'at': '<\%#>', 'char': '<BS>', 'input': '<BS><Del>'}, {'at': '\\\%#', 'char': '<LT>', 'input': '<LT>'}, ])
1 0.000032 0.000020 call urules.add('''''', [ {'at': '\%#', 'char': '''', 'input': '''''<Left>'}, {'at': '''\%#''', 'char': '''', 'input': '<Right>'}, {'at': '''\%#''', 'char': '<BS>', 'input': '<BS><Del>'}, {'at': '\\\%#', 'char': '''', 'input': ''''}, ])
1 0.000041 0.000027 call urules.add('""', [ {'at': '\%#', 'char': '"', 'input': '""<Left>'}, {'at': '"\%#"', 'char': '"', 'input': '<Right>'}, {'at': '"\%#"', 'char': '<BS>', 'input': '<BS><Del>'}, {'at': '\\\%#', 'char': '"', 'input': '"'}, ])
1 0.000031 0.000019 call urules.add('``', [ {'at': '\%#', 'char': '`', 'input': '``<Left>'}, {'at': '`\%#`', 'char': '`', 'input': '<Right>'}, {'at': '`\%#`', 'char': '<BS>', 'input': '<BS><Del>'}, {'at': '\\\%#', 'char': '`', 'input': '`'}, ])
1 0.000023 0.000011 call urules.add('English', [ {'at': '\w\%#', 'char': '''', 'input': ''''}, ])
1 0.000028 0.000016 call urules.add('Lisp quote', [ {'at': '\%#', 'char': '''', 'input': ''''}, {'at': '\%#', 'char': '''', 'input': '''''<Left>', 'syntax': ['Constant']}, ])
" FIXME: Add more rules like '(<Enter>)'
1 0.000022 0.000010 call urules.add('(<Enter>)', [ {'at': '(\%#)', 'char': '<Enter>', 'input': '<Enter>X<Enter>)<BS><Up><C-o>$<BS>'}, ])
1 0.000030 0.000011 call urules.add('case:', [ {'at': '\C\<case\>.*\%#', 'char': ':', 'input': ':'}, ])
1 0.000024 0.000012 call urules.add('default:', [ {'at': '\C\<default\>.*\%#', 'char': ':', 'input': ':'}, ])
1 0.000019 0.000007 call urules.add('x.y', [])
1 0.000018 0.000006 call urules.add('f(x)', [])
1 0.000019 0.000007 call urules.add('a[x]', [])
1 0.000019 0.000007 call urules.add('new', [])
1 0.000019 0.000007 call urules.add('typeof', [])
1 0.000019 0.000007 call urules.add('checked', [])
1 0.000018 0.000006 call urules.add('unchecked', [])
1 0.000018 0.000006 call urules.add('default(T)', [])
1 0.000018 0.000007 call urules.add('delegate', [])
1 0.000019 0.000008 call urules.add('+ (unary)', [])
1 0.000019 0.000007 call urules.add('- (unary)', [])
1 0.000018 0.000006 call urules.add('!', [])
1 0.000018 0.000007 call urules.add('~', [])
1 0.000019 0.000007 call urules.add('(T)x', [])
1 0.000018 0.000006 call urules.add('true', [])
1 0.000018 0.000007 call urules.add('false', [])
1 0.000019 0.000008 call urules.add('& (dereference)', [])
1 0.000019 0.000008 call urules.add('sizeof', [])
1 0.000019 0.000007 call urules.add('is', [])
1 0.000029 0.000016 call urules.add('as', [])
1 0.000026 0.000014 call urules.add('T<T>', [ {'at': '\V\V < \%#', 'char': '>', 'input': '<BS><BS><BS><LT>><Left>'}, {'at': '<\%#>', 'char': '<BS>', 'input': '<BS><Del>'}, ])
1 0.000036 0.000022 call urules.add('// comment', [ {'at': '\V\V / \%#', 'char': '/', 'input': '<BS><BS><BS>// '}, {'at': '// \%#', 'char': '<BS>', 'input': '<BS><BS><BS> / '}, ])
1 0.000026 0.000014 call urules.add('/// comment', [ {'at': '\V\V// \%#', 'char': '/', 'input': '<BS><BS><BS>/// '}, {'at': '/// \%#', 'char': '<BS>', 'input': '<BS><BS><BS><BS>// '}, ])
1 0.000026 0.000014 call urules.add('/* comment */', [ {'at': '\V\V / \%#', 'char': '*', 'input': '<BS><BS><BS>/* */<Left><Left><Left>'}, {'at': '/\* \%# \*/', 'char': '<BS>', 'input': '<BS><BS><BS><Del><Del><Del> / '}, ])
"}}}
" Single-character operator rules "{{{
14 0.000049 for operator_name in [ '=', '+', '-', '*', '/', '%', '<', '>', '|', '&', '^', '?', ':', ]
13 0.000052 let rule_set_name = operator_name
13 0.000448 0.000126 let k = s:_operator_key_from(operator_name)
13 0.000224 0.000131 let p = s:_operator_pattern_from(operator_name)
13 0.000064 let bs3 = repeat('<BS>', 3)
13 0.000632 0.000430 call urules.add(rule_set_name, [ {'at': '\%#', 'char': k, 'input': ' '.k.' '}, {'at': '\V '.p.' \%#', 'char': '<BS>', 'input': bs3}, {'at': '\S \%#', 'char': k, 'input': k.' '}, {'at': '\V '.p.' \%#', 'char': '<Space>', 'input': ''}, ])
13 0.000023 endfor
"}}}
" Double-character operator rules (normal) "{{{
19 0.000065 for operator_name in [ '==', '=>', '=~', '+=', '-=', '*=', '/=', '%=', '<=', '<<', '>=', '>>', '|=', '||', '&=', '&&', '^=', '??', ]
18 0.000179 let rule_set_name = operator_name
18 0.000661 0.000202 let kt = s:_operator_key_from(operator_name[1])
18 0.000630 0.000199 let k1 = s:_operator_key_from(operator_name[0])
18 0.000632 0.000198 let k2 = s:_operator_key_from(operator_name)
18 0.000322 0.000187 let p1 = s:_operator_pattern_from(operator_name[0])
18 0.000291 0.000164 let p2 = s:_operator_pattern_from(operator_name)
18 0.000084 let bs3 = repeat('<BS>', 3)
18 0.000080 let bs4 = repeat('<BS>', 4)
18 0.000845 0.000600 call urules.add(rule_set_name, [ {'at': '\V '.p1.' \%#', 'char': kt, 'input': bs3.' '.k2.' '}, {'at': '\V '.p2.' \%#', 'char': '<BS>', 'input': bs4.' '.k1.' '}, {'at': '\V '.p2.' \%#', 'char': '<Space>', 'input': ''}, ])
18 0.000030 endfor
"}}}
" Double-character operator rules (!=, etc) "{{{
3 0.000011 for operator_name in [ '!=', '!~', ]
2 0.000007 let rule_set_name = operator_name
2 0.000069 0.000022 let kt = s:_operator_key_from(operator_name[1])
2 0.000068 0.000022 let k1 = s:_operator_key_from(operator_name[0])
2 0.000065 0.000019 let k2 = s:_operator_key_from(operator_name)
2 0.000036 0.000022 let p1 = s:_operator_pattern_from(operator_name[0])
2 0.000033 0.000020 let p2 = s:_operator_pattern_from(operator_name)
2 0.000010 let bs1 = repeat('<BS>', 1)
2 0.000009 let bs4 = repeat('<BS>', 4)
2 0.000083 0.000057 call urules.add(rule_set_name, [ {'at': '\V'.p1.'\%#', 'char': kt, 'input': bs1.' '.k2.' '}, {'at': '\V '.p2.' \%#', 'char': '<BS>', 'input': bs4.k1}, {'at': '\V '.p2.' \%#', 'char': '<Space>', 'input': ''}, ])
2 0.000003 endfor
"}}}
" Double-character operator rules (++, etc) "{{{
4 0.000013 for operator_name in [ '++', '--', '->', ]
3 0.000012 let rule_set_name = operator_name
3 0.000119 0.000044 let kt = s:_operator_key_from(operator_name[1])
3 0.000103 0.000034 let k1 = s:_operator_key_from(operator_name[0])
3 0.000097 0.000029 let k2 = s:_operator_key_from(operator_name)
3 0.000053 0.000031 let p1 = s:_operator_pattern_from(operator_name[0])
3 0.000057 0.000036 let p2 = s:_operator_pattern_from(operator_name)
3 0.000015 let bs2 = repeat('<BS>', 2)
3 0.000012 let bs3 = repeat('<BS>', 3)
3 0.000120 0.000072 call urules.add(rule_set_name, [ {'at': '\V '.p1.' \%#', 'char': kt, 'input': bs3.k2}, {'at': '\V'.p2.'\%#', 'char': '<BS>', 'input': bs2.' '.k1.' '}, ])
3 0.000013 endfor
"}}}
" Triple-character operator rules "{{{
6 0.000022 for operator_name in [ '===', '!==', '<=>', '<<=', '>>=', ]
5 0.000020 let rule_set_name = operator_name
5 0.000182 0.000057 let kt = s:_operator_key_from(operator_name[2])
5 0.000189 0.000063 let k2 = s:_operator_key_from(operator_name[:1])
5 0.000169 0.000050 let k3 = s:_operator_key_from(operator_name)
5 0.000091 0.000055 let p2 = s:_operator_pattern_from(operator_name[:1])
5 0.000082 0.000047 let p3 = s:_operator_pattern_from(operator_name)
5 0.000025 let bs4 = repeat('<BS>', 4)
5 0.000024 let bs5 = repeat('<BS>', 5)
5 0.000281 0.000167 call urules.add(rule_set_name, [ {'at': '\V '.p2.' \%#', 'char': kt, 'input': bs4.' '.k3.' '}, {'at': '\V '.p3.' \%#', 'char': '<BS>', 'input': bs5.' '.k2.' '}, {'at': '\V '.p3.' \%#', 'char': '<Space>', 'input': ''}, ])
5 0.000011 endfor
"}}}
" ft_urule_sets_table... "{{{
1 0.000118 let ft_urule_sets_table = { '*': [ urules.table['()'], urules.table['[]'], urules.table['{}'], urules.table['<>'], urules.table[''''''], urules.table['""'], urules.table['``'], urules.table['English'], urules.table['(<Enter>)'], ], 'cs': [ urules.table['x.y'], urules.table['f(x)'], urules.table['a[x]'], urules.table['++'], urules.table['--'], urules.table['new'], urules.table['typeof'], urules.table['checked'], urules.table['unchecked'], urules.table['default(T)'], urules.table['delegate'], urules.table['->'], urules.table['+ (unary)'], urules.table['- (unary)'], urules.table['!'], urules.table['~'], urules.table['(T)x'], urules.table['true'], urules.table['false'], urules.table['& (dereference)'], urules.table['sizeof'], urules.table['*'], urules.table['/'], urules.table['%'], urules.table['+'], urules.table['-'], urules.table['<<'], urules.table['>>'], urules.table['<'], urules.table['>'], urules.table['<='], urules.table['>='], urules.table['is'], urules.table['as'], urules.table['=='], urules.table['!='], urules.table['&'], urules.table['^'], urules.table['|'], urules.table['&&'], urules.table['||'], urules.table['??'], urules.table['?'], urules.table[':'], urules.table['case:'], urules.table['default:'], urules.table['='], urules.table['+='], urules.table['-='], urules.table['*='], urules.table['/='], urules.table['%='], urules.table['&='], urules.table['|='], urules.table['^='], urules.table['<<='], urules.table['>>='], urules.table['=>'], urules.table['T<T>'], urules.table['// comment'], urules.table['/// comment'], urules.table['/* comment */'], ], 'javascript': [ urules.table['='], urules.table['=='], urules.table['==='], urules.table['!='], urules.table['!=='], ], 'lisp': [ urules.table['Lisp quote'], ], 'ruby': [ urules.table['<'], urules.table['<='], urules.table['<=>'], ], 'scheme': [ urules.table['Lisp quote'], ], 'vim': [ urules.table['='], urules.table['=~'], urules.table['!~'], ], }
"}}}
10 0.000025 for urule_set in ft_urule_sets_table['*']
39 0.000095 for urule in urule_set
30 0.081141 0.000282 call smartpunc#define_rule(urule)
30 0.000080 endfor
9 0.000010 endfor
1 0.000005 let overlaied_urules = {}
1 0.000005 let overlaied_urules.pairs = [] " [(URule, [FileType])]
1 0.000005 function! overlaied_urules.add(urule, ft)
for [urule, fts] in self.pairs
if urule is a:urule
call add(fts, a:ft)
return
endif
endfor
call add(self.pairs, [a:urule, [a:ft]])
endfunction
7 0.000037 for ft in filter(keys(ft_urule_sets_table), 'v:val != "*"')
81 0.000185 for urule_set in ft_urule_sets_table[ft]
243 0.000534 for urule in urule_set
168 0.136178 0.001568 call overlaied_urules.add(urule, ft)
168 0.000334 endfor
75 0.000110 endfor
6 0.000008 endfor
146 0.000551 for [urule, fts] in overlaied_urules.pairs
145 0.001457 let completed_urule = copy(urule)
145 0.000687 let completed_urule.filetype = fts
145 2.858838 0.001515 call smartpunc#define_rule(completed_urule)
145 0.000527 endfor
" Add more useful rules?
FUNCTION <SNR>2__trigger_or_fallback()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
let nrule = s:find_the_most_proper_rule(s:available_nrules, a:char)
if nrule is 0
return a:fallback
else
return nrule._input
endif
FUNCTION <SNR>2_calculate_rule_priority()
Called 175 times
Total time: 0.002664
Self time: 0.002664
count total (s) self (s)
175 0.002425 return len(a:snrule.at) + (a:snrule.filetype is 0 ? 0 : 100 / len(a:snrule.filetype)) + (a:snrule.syntax is 0 ? 0 : 100 / len(a:snrule.syntax))
FUNCTION <SNR>2__encode_for_map_char_expr()
Called 64 times
Total time: 0.001705
Self time: 0.001705
count total (s) self (s)
64 0.000247 let s = a:rhs_char
64 0.000561 let s = substitute(s, '<', '<Bslash><LT>', 'g')
64 0.000334 let s = escape(s, '"')
64 0.000271 let s = '"' . s . '"'
64 0.000140 return s
FUNCTION smartpunc#define_rule()
Called 175 times
Total time: 2.938182
Self time: 1.704157
count total (s) self (s)
175 0.022674 0.001831 let nrule = s:normalize_rule(a:urule)
175 1.215103 0.001921 call s:remove_a_same_rule(s:available_nrules, nrule)
175 0.001002 call add(s:available_nrules, nrule)
175 1.698787 call map( reverse( sort( map( s:available_nrules, '[printf("%06d:%s", v:val.priority, v:val.at), v:val]' ) ) ), 'v:val[1]' )
FUNCTION smartpunc#map_to_trigger()
Called 32 times
Total time: 0.004066
Self time: 0.002361
count total (s) self (s)
" According to :help 'autoindent' --
"
" > Copy indent from current line when starting a new line
" > (typing <CR> in Insert mode or when using the "o" or "O" command).
" > If you do not type anything on the new line except <BS> or CTRL-D
" > and then type <Esc>, CTRL-O or <CR>, the indent is deleted again.
"
" So that a:rhs_fallback MUST be mapped from a:lhs without leaving from
" Insert mode to keep the behavior on automatic indentation when
" a:rhs_fallback == '<Enter>',
32 0.001215 0.000346 let char_expr = s:_encode_for_map_char_expr(a:rhs_char)
32 0.001191 0.000355 let fallback_expr = s:_encode_for_map_char_expr(a:rhs_fallback)
32 0.001301 execute printf('inoremap %s %s <SID>_trigger_or_fallback(%s, %s)', '<script> <expr> <silent>', a:lhs, char_expr, fallback_expr)
FUNCTION smartpunc#sid()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
return maparg('<SID>', 'n')
FUNCTION <SNR>2_remove_a_same_rule()
Called 175 times
Total time: 1.213182
Self time: 0.315531
count total (s) self (s)
15400 0.034765 for i in range(len(a:nrules))
15225 1.055683 0.158032 if s:are_same_rules(a:nrule, a:nrules[i])
call remove(a:nrules, i)
return
endif
15225 0.022383 endfor
FUNCTION smartpunc#clear_rules()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
let s:available_nrules = []
FUNCTION <SNR>2_normalize_rule()
Called 175 times
Total time: 0.020843
Self time: 0.014244
count total (s) self (s)
175 0.001444 let nrule = deepcopy(a:urule)
175 0.003984 0.001953 let nrule._char = s:decode_key_notation(nrule.char)
175 0.003775 0.001871 let nrule._input = s:decode_key_notation(nrule.input)
175 0.000775 if has_key(nrule, 'filetype')
145 0.000692 call sort(nrule.filetype)
145 0.000228 else
30 0.000107 let nrule.filetype = 0
30 0.000038 endif
175 0.000678 if has_key(nrule, 'syntax')
1 0.000004 call sort(nrule.syntax)
1 0.000001 else
174 0.000574 let nrule.syntax = 0
174 0.000252 endif
175 0.004416 0.001752 let nrule.priority = s:calculate_rule_priority(nrule)
175 0.000401 return nrule
FUNCTION <SNR>2_decode_key_notation()
Called 350 times
Total time: 0.003935
Self time: 0.003935
count total (s) self (s)
350 0.003559 return eval('"' . escape(a:s, '<"\') . '"')
FUNCTION <SNR>2_sid_value()
Called 0 times
Total time: 0.000000
Self time: 0.000000
count total (s) self (s)
return substitute(smartpunc#sid(), '<SNR>', "\<SNR>", 'g')
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
1 3.099303 0.003088 <SNR>1_set_up_the_default_configuration()
1 3.090452 0.013711 smartpunc#define_default_rules()
175 2.938182 1.704157 smartpunc#define_rule()
175 1.213182 0.315531 <SNR>2_remove_a_same_rule()
15225 0.897651 <SNR>2_are_same_rules()
175 0.020843 0.014244 <SNR>2_normalize_rule()
32 0.004066 0.002361 smartpunc#map_to_trigger()
350 0.003935 <SNR>2_decode_key_notation()
175 0.002664 <SNR>2_calculate_rule_priority()
97 0.002367 <SNR>2__operator_key_from()
64 0.001705 <SNR>2__encode_for_map_char_expr()
69 0.000496 <SNR>2__operator_pattern_from()
1 0.000004 smartpunc#scope()
<SNR>2_sid_value()
<SNR>2_nrule_comparer_desc()
<SNR>2__trigger_or_fallback()
smartpunc#sid()
smartpunc#clear_rules()
<SNR>2_find_the_most_proper_rule()
FUNCTIONS SORTED ON SELF TIME
count total (s) self (s) function
175 2.938182 1.704157 smartpunc#define_rule()
15225 0.897651 <SNR>2_are_same_rules()
175 1.213182 0.315531 <SNR>2_remove_a_same_rule()
175 0.020843 0.014244 <SNR>2_normalize_rule()
1 3.090452 0.013711 smartpunc#define_default_rules()
350 0.003935 <SNR>2_decode_key_notation()
1 3.099303 0.003088 <SNR>1_set_up_the_default_configuration()
175 0.002664 <SNR>2_calculate_rule_priority()
97 0.002367 <SNR>2__operator_key_from()
32 0.004066 0.002361 smartpunc#map_to_trigger()
64 0.001705 <SNR>2__encode_for_map_char_expr()
69 0.000496 <SNR>2__operator_pattern_from()
1 0.000004 smartpunc#scope()
smartpunc#sid()
smartpunc#clear_rules()
<SNR>2_find_the_most_proper_rule()
<SNR>2_sid_value()
<SNR>2_nrule_comparer_desc()
<SNR>2__trigger_or_fallback()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment