good luck about 'table>(tr>td*3)*4'

This commit is contained in:
mattn
2010-02-26 17:50:17 +09:00
parent f33f8aab68
commit 98116f925e

View File

@@ -830,7 +830,7 @@ function! s:zen_parseIntoTree(abbr, type)
endif endif
let abbr = substitute(abbr, '\([a-z][a-z0-9]*\)+\([()]\|$\)', '\="(".s:zen_expandos(submatch(1), type).")".submatch(2)', 'i') let abbr = substitute(abbr, '\([a-z][a-z0-9]*\)+\([()]\|$\)', '\="(".s:zen_expandos(submatch(1), type).")".submatch(2)', 'i')
let mx = '\([+>]\|<\+\)\{-}\s*\((*\)\{-}\s*\([@#]\{-}[a-z][a-z0-9:\!\-]*\|{[^}]\+}\)\(\%(\%(#[0-9A-Za-z_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.[0-9A-Za-z_\-\$]\+\)\)*\)\%(\({[^}]\+}\)\)\{0,1}\%(\*\([0-9]\+\)\)\{0,1}\s*\(+*)\+\)\{0,1}' let mx = '\([+>]\|<\+\)\{-}\s*\((*\)\{-}\s*\([@#]\{-}[a-z][a-z0-9:\!\-]*\|{[^}]\+}\)\(\%(\%(#[0-9A-Za-z_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.[0-9A-Za-z_\-\$]\+\)\)*\)\%(\({[^}]\+}\)\)\{0,1}\%(\*\([0-9]\+\)\)\{0,1}\s*\()\+\)\{0,1}\%(\*\([0-9]\+\)\)\{0,1}'
let root = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0 } let root = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0 }
let parent = root let parent = root
let last = root let last = root
@@ -845,6 +845,7 @@ function! s:zen_parseIntoTree(abbr, type)
let value = substitute(match, mx, '\5', 'ig') let value = substitute(match, mx, '\5', 'ig')
let multiplier = 0 + substitute(match, mx, '\6', 'ig') let multiplier = 0 + substitute(match, mx, '\6', 'ig')
let block_end = substitute(match, mx, '\7', 'ig') let block_end = substitute(match, mx, '\7', 'ig')
let multiplier_block = 0 + substitute(match, mx, '\8', 'ig')
if len(str) == 0 if len(str) == 0
break break
endif endif
@@ -852,9 +853,8 @@ function! s:zen_parseIntoTree(abbr, type)
let attributes = tag_name . attributes let attributes = tag_name . attributes
let tag_name = 'div' let tag_name = 'div'
endif endif
if multiplier <= 0 if multiplier <= 0 | let multiplier = 1 | endif
let multiplier = 1 if multiplier_block <= 0 | let multiplier_block = 1 | endif
endif
if has_key(s:zen_settings[type], 'aliases') if has_key(s:zen_settings[type], 'aliases')
if has_key(s:zen_settings[type]['aliases'], tag_name) if has_key(s:zen_settings[type]['aliases'], tag_name)
let tag_name = s:zen_settings[type]['aliases'][tag_name] let tag_name = s:zen_settings[type]['aliases'][tag_name]
@@ -910,6 +910,7 @@ function! s:zen_parseIntoTree(abbr, type)
let current['value'] = value let current['value'] = value
endif endif
let current['multiplier'] = multiplier let current['multiplier'] = multiplier
let current['multiplier'] = multiplier
if !empty(last) if !empty(last)
if operator =~ '>' if operator =~ '>'
@@ -958,6 +959,7 @@ function! s:zen_parseIntoTree(abbr, type)
endfor endfor
call remove(pos, -1) call remove(pos, -1)
let last = parent let last = parent
let last['child'][-1]['multiplier'] = multiplier_block
let last['pos'] += 1 let last['pos'] += 1
endfor endfor
endif endif
@@ -971,6 +973,7 @@ function! s:zen_parseIntoTree(abbr, type)
echo "value=".value echo "value=".value
echo "multiplier=".multiplier echo "multiplier=".multiplier
echo "block_end=".block_end echo "block_end=".block_end
echo "multiplier_block=".multiplier_block
echo "abbr=".abbr echo "abbr=".abbr
echo "pos=".string(pos) echo "pos=".string(pos)
echo "\n" echo "\n"
@@ -1240,5 +1243,6 @@ endif
"echo ZenExpand('(#header>h1)+#content+#footer', '') "echo ZenExpand('(#header>h1)+#content+#footer', '')
"echo ZenExpand('(#header>h1)+(#content>(#main>h2+div#entry$.section*5>(h3>a)+div>p*3+ul+)+(#utilities))+(#footer>address)', '') "echo ZenExpand('(#header>h1)+(#content>(#main>h2+div#entry$.section*5>(h3>a)+div>p*3+ul+)+(#utilities))+(#footer>address)', '')
"echo ZenExpand('(div>(ul))+(#utilities)', '') "echo ZenExpand('(div>(ul))+(#utilities)', '')
"echo ZenExpand('table>(tr>td*3)*4', '')
" vim:set et: " vim:set et: