mirror of
https://github.com/Nexoniarz/Finch.git
synced 2026-11-03 16:54:25 +00:00
16 lines
1.5 KiB
JSON
16 lines
1.5 KiB
JSON
{
|
|
"main": { "prefix": "main", "body": ["fn main() {", "\t$0", "}"], "description": "The program's start" },
|
|
"main with arguments": { "prefix": "mainargs", "body": ["fn main([]str args) {", "\t$0", "}"], "description": "main that gets the command-line arguments" },
|
|
"function": { "prefix": "fn", "body": ["fn ${1:name}(${2}) {", "\t$0", "}"], "description": "A function" },
|
|
"function with result": { "prefix": "fnr", "body": ["fn ${1:name}(${2}) -> ${3:int} {", "\t$0", "}"], "description": "A function that returns a value" },
|
|
"struct": { "prefix": "struct", "body": ["struct ${1:Name} {", "\t${2:int} ${3:field}", "}"], "description": "A struct" },
|
|
"if": { "prefix": "if", "body": ["if ${1:condition} {", "\t$0", "}"] },
|
|
"if else": { "prefix": "ife", "body": ["if ${1:condition} {", "\t$2", "} else {", "\t$0", "}"] },
|
|
"for range": { "prefix": "for", "body": ["for ${1:i} in ${2:0}..${3:n} {", "\t$0", "}"], "description": "Count from start to end-1" },
|
|
"for each": { "prefix": "foreach", "body": ["for ${1:item} in ${2:list} {", "\t$0", "}"], "description": "Every element of an array or str" },
|
|
"while": { "prefix": "while", "body": ["while ${1:condition} {", "\t$0", "}"] },
|
|
"print": { "prefix": "print", "body": ["print(${1})"] },
|
|
"input": { "prefix": "input", "body": ["${1:answer} := input(\"${2:Question? }\")"] },
|
|
"import C header": { "prefix": "importc", "body": ["import \"${1:stdio.h}\""] },
|
|
"defer": { "prefix": "defer", "body": ["defer ${1}"], "description": "Run this when the block ends" }
|
|
}
|