2014-06-05 11:41:17 -04:00
|
|
|
snippet fun
|
2014-06-11 14:06:51 -04:00
|
|
|
function ${1:functionname}(${2:parameters})
|
|
|
|
${0}
|
|
|
|
end
|
2014-06-05 11:41:17 -04:00
|
|
|
|
|
|
|
# For loop iterating over iterable container
|
|
|
|
snippet forin
|
2014-06-11 14:06:51 -04:00
|
|
|
for ${1} in ${2}
|
|
|
|
${0}
|
|
|
|
end
|
2014-06-05 11:41:17 -04:00
|
|
|
|
|
|
|
# Standard for loop
|
|
|
|
snippet for
|
2014-06-11 14:06:51 -04:00
|
|
|
for ${1} = ${2}
|
|
|
|
${0}
|
|
|
|
end
|
2014-06-05 11:41:17 -04:00
|
|
|
|
|
|
|
# Nested for loop
|
|
|
|
snippet fornest
|
2014-06-11 14:06:51 -04:00
|
|
|
for ${1} = ${2}, ${3} = ${4}
|
|
|
|
${0}
|
|
|
|
end
|
2014-06-05 11:41:17 -04:00
|
|
|
|
|
|
|
# While loop
|
|
|
|
snippet while
|
2014-06-11 14:06:51 -04:00
|
|
|
while ${1} ${2:<=} ${3}
|
|
|
|
${0}
|
|
|
|
end
|
2014-06-05 11:41:17 -04:00
|
|
|
|
|
|
|
# Try catch
|
|
|
|
snippet try
|
2014-06-11 14:06:51 -04:00
|
|
|
try
|
|
|
|
${1}
|
|
|
|
catch ${2}
|
|
|
|
${0}
|
|
|
|
end
|