1
0
nvim-config/pythonx/ultisnips/c.py
2016-04-22 09:55:44 +02:00

27 lines
519 B
Python

def returnval(t):
if t == "void":
return ""
ret = {
"int": "0",
"float": "0.0",
"double": "0.0",
"bool": "false"
}
if t in ret.keys():
return "return " + ret[t] + ";"
else:
return "return NULL;"
def getNoteCandidates(t):
options = ["TODO", "FIXME", "XXX"]
if t:
options = [ x[len(t):] for x in options if x.startswith(t) ]
if len(options) == 1:
return options[0]
return "[" + ",".join(options) + "]"