我在lua中有一张桌子:
enUS = {
LOCALE_STHOUSANDS = ",", --Thousands separator e.g. comma
patNumber = "%d+["..LOCALE_STHOUSANDS.."%d]*", --regex to find a number
["PreScanPatterns"] = {
["^("..patNumber..") Armor$"] = "ARMOR",
}
}
所以你会看到这个表中有一个完整的自引用链:
LOCAL_STHOUSANDS
patNumber
["^("..patNumber..") Armor$"]
如何在 lua 表中执行自引用?
我不想做的是必须硬替换这些值;有数百个参考:
enUS = {
LOCALE_STHOUSANDS = ",", --Thousands separator e.g. comma
patNumber = "%d+[,%d]*", --regex to find a number
["PreScanPatterns"] = {
["^(%d+[,%d]*) Armor$"] = "ARMOR",
}
}