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