55 lines
590 B
Plaintext
55 lines
590 B
Plaintext
snippet fun "New function"
|
|
function ${1:Name} ($2)
|
|
$3
|
|
end;
|
|
$0
|
|
endsnippet
|
|
|
|
snippet while "while-loop"
|
|
while (${1:true})
|
|
do
|
|
$1
|
|
end;
|
|
$0
|
|
endsnippet
|
|
|
|
snippet for "for loop"
|
|
for ${1:i = 0}, ${2:target}, ${3:1}
|
|
do
|
|
$4
|
|
end;
|
|
$0
|
|
endsnippet
|
|
|
|
snippet repeat "repeat until loop"
|
|
repeat
|
|
$2
|
|
until (${1:Condition});
|
|
$0
|
|
endsnippet
|
|
|
|
snippet ifthen "normal if clause"
|
|
if (${1:Condition})
|
|
then
|
|
$2
|
|
end;
|
|
$0
|
|
endsnippet
|
|
|
|
snippet ifelse "if and else clause"
|
|
if (${1:Condition})
|
|
then
|
|
$1
|
|
else
|
|
$2
|
|
end;
|
|
$0
|
|
endsnippet
|
|
|
|
snippet "= fun" "Assign a function" rA
|
|
= function(${1:Parameter})
|
|
$2
|
|
end;$0
|
|
endsnippet
|
|
|