{
  "Main Function": {
    "prefix": "main",
    "body": [
      "fn main() -> int:",
      "\t$0",
      "\tret 0"
    ],
    "description": "Program entry point"
  },
  "Function Definition": {
    "prefix": "fn",
    "body": [
      "fn ${1:name}(${2:params}) -> ${3:int}:",
      "\t$0"
    ],
    "description": "Define a TezzNative function"
  },
  "Import Module": {
    "prefix": "import",
    "body": [
      "import \"${1:std}\""
    ],
    "description": "Import a TezzNative module"
  },
  "Extern Function": {
    "prefix": "extern",
    "body": [
      "@abi(\"c\")",
      "extern fn ${1:name}(${2:params}) -> ${3:int}"
    ],
    "description": "Declare a C ABI function"
  },
  "Struct Definition": {
    "prefix": "struct",
    "body": [
      "struct ${1:Name}:",
      "\t${2:field}:${3:type}",
      "\t$0"
    ],
    "description": "Define a TezzNative struct"
  },
  "If Statement": {
    "prefix": "if",
    "body": [
      "if ${1:condition}:",
      "\t$0"
    ],
    "description": "Conditional if block"
  },
  "While Loop": {
    "prefix": "while",
    "body": [
      "while ${1:condition}:",
      "\t$0"
    ],
    "description": "While loop block"
  },
  "Unsafe Block": {
    "prefix": "unsafe",
    "body": [
      "unsafe:",
      "\t$0"
    ],
    "description": "Pointer and low-level operation block"
  },
  "File Read Write": {
    "prefix": "file_rw",
    "body": [
      "import \"io\"",
      "",
      "fn main() -> int:",
      "\tpath:str = \"${1:out.txt}\"",
      "\tdata:str = \"${2:saved}\"",
      "\tf:*File = io.open_w(path)",
      "\tif f == 0:",
      "\t\tret 1",
      "\tp:*char",
      "\tunsafe:",
      "\t\tp = data as *char",
      "\tio.file_write(f, p, len(data))",
      "\tio.file_close(f)",
      "\tret 0"
    ],
    "description": "Write a small file through the io module"
  },
  "HTTP Response Parse": {
    "prefix": "http_parse",
    "body": [
      "import \"net\"",
      "",
      "fn main() -> int:",
      "\tresp:str = \"HTTP/1.1 200 OK\\nContent-Length: 2\\n\\nok\"",
      "\tif net.http_status_code(resp) != 200:",
      "\t\tret 1",
      "\tret 0"
    ],
    "description": "Parse a deterministic HTTP response"
  }
}
