Merge commit '62ef855ef42e7c0fc9c0' into mustache

This commit is contained in:
mattn
2010-08-25 15:53:54 +09:00
2 changed files with 37 additions and 17 deletions

View File

@@ -400,5 +400,22 @@ finish
},
],
},
{
'category': 'mustache',
'tests': [
{
'name': "div#{{foo}}",
'query': "div#{{foo}}",
'type': "mustache",
'result': "<div id=\"{{foo}}\"></div>\n",
},
{
'name': "div.{{foo}}",
'query': "div.{{foo}}",
'type': "mustache",
'result': "<div class=\"{{foo}}\"></div>\n",
},
],
},
]
" vim:set et:

View File

@@ -846,6 +846,9 @@ let s:zen_settings = {
\ },
\ 'xhtml': {
\ 'extends': 'html'
\ },
\ 'mustache': {
\ 'extends': 'html'
\ }
\}
@@ -905,7 +908,7 @@ function! s:zen_parseIntoTree(abbr, type)
endif
let abbr = substitute(abbr, '\([a-zA-Z][a-zA-Z0-9]*\)+\([()]\|$\)', '\="(".s:zen_expandos(type, submatch(1)).")".submatch(2)', 'i')
let mx = '\([+>]\|<\+\)\{-}\s*\((*\)\{-}\s*\([@#]\{-}[a-zA-Z\!][a-zA-Z0-9:\!\-]*\|{[^}]\+}\)\(\%(\%(#[a-zA-Z0-9_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.[a-zA-Z0-9_\-\$]\+\)\)*\)\%(\({[^}]\+}\)\)\{0,1}\%(\s*\*\s*\([0-9]\+\)\s*\)\{0,1}\(\%(\s*)\%(\s*\*\s*[0-9]\+\s*\)\{0,1}\)*\)'
let mx = '\([+>]\|<\+\)\{-}\s*\((*\)\{-}\s*\([@#]\{-}[a-zA-Z\!][a-zA-Z0-9:\!\-]*\|{[^}]\+}\)\(\%(\%(#[{}a-zA-Z0-9_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.[{}a-zA-Z0-9_\-\$]\+\)\)*\)\%(\({[^}]\+}\)\)\{0,1}\%(\s*\*\s*\([0-9]\+\)\s*\)\{0,1}\(\%(\s*)\%(\s*\*\s*[0-9]\+\s*\)\{0,1}\)*\)'
let root = { 'name': '', 'attr': {}, 'child': [], 'snippet': '', 'multiplier': 1, 'parent': {}, 'value': '', 'pos': 0 }
let parent = root
let last = root
@@ -980,7 +983,7 @@ function! s:zen_parseIntoTree(abbr, type)
if len(attributes)
let attr = attributes
while len(attr)
let item = matchstr(attr, '\(\%(\%(#[a-zA-Z0-9_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.[a-zA-Z0-9_\-\$]\+\)*\)\)')
let item = matchstr(attr, '\(\%(\%(#[{}a-zA-Z0-9_\-\$]\+\)\|\%(\[[^\]]\+\]\)\|\%(\.[{}a-zA-Z0-9_\-\$]\+\)*\)\)')
if len(item) == 0
break
endif