mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-28 18:24:01 +00:00
Refactor json macro (#12391)
* closes #12316 * make tjsonmacro work at js target * closes #12289 * closes #11988 * also fixed gdb related stuff
This commit is contained in:
committed by
Andreas Rumpf
parent
5ba932e43c
commit
21cbfd72ec
@@ -30,7 +30,7 @@ def getNimRti(type_name):
|
||||
m = type_hash_regex.match(type_name)
|
||||
if m:
|
||||
try:
|
||||
return gdb.parse_and_eval("NTI_" + m.group(1) + "_")
|
||||
return gdb.parse_and_eval("NTI__" + m.group(1) + "_")
|
||||
except:
|
||||
return None
|
||||
|
||||
@@ -340,13 +340,13 @@ def reprEnum(e, typ):
|
||||
return str(e) + " (invalid data!)"
|
||||
|
||||
class NimEnumPrinter:
|
||||
pattern = re.compile(r'^tyEnum_(\w*)_([A-Za-z0-9]*)$')
|
||||
pattern = re.compile(r'^tyEnum_(\w*)__([A-Za-z0-9]*)$')
|
||||
|
||||
def __init__(self, val):
|
||||
self.val = val
|
||||
match = self.pattern.match(self.val.type.name)
|
||||
self.typeNimName = match.group(1)
|
||||
typeInfoName = "NTI_" + match.group(2) + "_"
|
||||
typeInfoName = "NTI__" + match.group(2) + "_"
|
||||
self.nti = gdb.lookup_global_symbol(typeInfoName)
|
||||
|
||||
if self.nti is None:
|
||||
@@ -373,7 +373,7 @@ class NimSetPrinter:
|
||||
match = self.pattern.match(self.val.type.name)
|
||||
self.typeNimName = match.group(1)
|
||||
|
||||
typeInfoName = "NTI_" + match.group(2) + "_"
|
||||
typeInfoName = "NTI__" + match.group(2) + "_"
|
||||
self.nti = gdb.lookup_global_symbol(typeInfoName)
|
||||
|
||||
if self.nti is None:
|
||||
|
||||
Reference in New Issue
Block a user