[Add] 打通Kconfiglib配置操作

This commit is contained in:
gaoyang3513
2024-11-16 17:04:01 +08:00
parent ebd1227d82
commit b2473d60d5
110 changed files with 21987 additions and 4 deletions

View File

@ -0,0 +1,22 @@
def add(kconf, name, *args):
return str(sum(map(int, args)))
def one(kconf, name, s):
return name + 2*s
def one_or_more(kconf, name, arg, *args):
return arg + " + " + ",".join(args)
def location(kconf, name):
return "{}:{}".format(kconf.filename, kconf.linenr)
functions = {
"add": (add, 0, None),
"one": (one, 1, 1),
"one-or-more": (one_or_more, 1, None),
"location": (location, 0, 0),
}