Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"null": "None",
}
if obj in table:
return HySymbol(table[obj])
if obj.startswith(":"):
return HyKeyword(obj)
if obj.startswith("*") and obj.endswith("*") and obj not in ("*", "**"):
obj = obj[1:-1].upper()
if "-" in obj and obj != "-":
obj = obj.replace("-", "_")
return HySymbol(obj)
def router(tree, rkwargs=None):
tree = HyExpression(tree)
name = tree.pop(0)
path = tree.pop(0)
tree.insert(0, HySymbol("fn"))
tree = HyExpression([HySymbol("def"), name, tree])
route = HyExpression([HySymbol(".route"), HySymbol("app"), path])
if rkwargs:
route = HyExpression([HySymbol("kwapply"), route,
HyDict({HyString("methods"): rkwargs})])
return HyExpression([HySymbol("with_decorator"), route, tree])
def defn_macro(name, *body):
return HyExpression([HySymbol("def"),
name, HyExpression([HySymbol("fn")] + list(body))])