Add switch case and select statements

This commit is contained in:
Steven Oliver 2012-05-19 21:05:21 -04:00
parent 273bd9197a
commit 33972c2b4f

View File

@ -1,23 +1,28 @@
snippet #! snippet #!
#!/usr/bin/env falcon #!/usr/bin/env falcon
# Import # Import
snippet imp snippet imp
import ${1:module} import ${1:module}
# Function # Function
snippet fun snippet fun
function ${2:function_name}(${3}) function ${2:function_name}(${3})
${4:/* code */} ${4:/* code */}
end end
# Class # Class
snippet class snippet class
class ${1:class_name}(${2:class_params}) class ${1:class_name}(${2:class_params})
${3:/* members/methods */} ${3:/* members/methods */}
end end
# If # If
snippet if snippet if
if ${1:condition} if ${1:condition}
${2:/* code */} ${2:/* code */}
end end
# If else # If else
snippet ife snippet ife
if ${1:condition} if ${1:condition}
@ -25,20 +30,40 @@ snippet ife
else else
${1} ${1}
end end
# If else if # If else if
snippet elif snippet elif
elif ${1:condition} elif ${1:condition}
${2:/* code */} ${2:/* code */}
# Switch case
snippet switch
switch ${1:expression}
case ${2:item}
case ${3:item}
default
end
# Select
snippet select
select ${1:variable}
case ${2:TypeSpec}
case ${3:TypeSpec}
default
end
# For/in Loop # For/in Loop
snippet forin snippet forin
for ${1:element} in ${2:container} for ${1:element} in ${2:container}
${3:/* code */} ${3:/* code */}
end end
# For/to Loop # For/to Loop
snippet forto snippet forto
for ${1:lowerbound} to ${2:upperbound} for ${1:lowerbound} to ${2:upperbound}
${3:/* code */} ${3:/* code */}
end end
# While Loop # While Loop
snippet while snippet while
while ${1:conidition} while ${1:conidition}