Merge pull request #145 from jackStalnaker/switchcase

added switch, switch with no default, and case snippets to c snippets
This commit is contained in:
Honza Pokorny 2012-10-18 15:41:02 -07:00
commit 970fd404a6

View File

@ -68,6 +68,27 @@ snippet elif
# ternary
snippet t
${1:/* condition */} ? ${2:a} : ${3:b}
# switch
snippet switch
switch (${1:/* variable */}) {
case ${2:/* variable case */}:
${3}
${4:break;}${5}
default:
${6}
}${7}
# switch without default
snippet switchndef
switch (${1:/* variable */}) {
case ${2:/* variable case */}:
${3}
${4:break;}${5}
}${6}
# case
snippet case
case ${1:/* variable case */}:
${2}
${3:break;}${4}
##
## Loops
# for