KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
i have a table in lua: enUS = { LOCALE_STHOUSANDS = ",", --Thousands separator e.g. comma patNumber = "%d+["..LOCALE_STHOUSANDS.."%d]*", --regex to find a number ["PreScanPatterns"] = { ["^("..patNumber..") Armor$"] = "ARMOR", } } So you see there is a whole chain of self-references in this table: LOCAL_STHOUSANDS patNumber ["^("..patNumber..") Armor$"] How can i perform self-referencing in an lua table? What i don't want to do is have to hard-replace the values; there are hundreds of references: enUS = { LOCALE_STHOUSANDS = ",", --Thousands separator e.g. comma patNumber = "%d+[,%d]*", --regex to find a number ["PreScanPatterns"] = { ["^(%d+[,%d]*) Armor$"] = "ARMOR", } }
Tags (comma-separated)
Save Edits
Cancel