added switch, switch with no default, and case snippets to c snippets

This commit is contained in:
Jack Stalnaker 2012-10-18 16:27:02 -05:00
parent 925c6daac7
commit 28ce3bb6f4

View File

@ -68,6 +68,27 @@ snippet elif
# ternary # ternary
snippet t snippet t
${1:/* condition */} ? ${2:a} : ${3:b} ${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 ## Loops
# for # for