mirror of
https://github.com/nim-lang/Nim.git
synced 2026-05-02 12:04:44 +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
@@ -98,3 +98,4 @@ proc initDefines*(symbols: StringTableRef) =
|
||||
defineSymbol("nimHasStyleChecks")
|
||||
defineSymbol("nimToOpenArrayCString")
|
||||
defineSymbol("nimHasUsed")
|
||||
defineSymbol("nimFixedForwardGeneric")
|
||||
|
||||
@@ -1121,9 +1121,16 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool =
|
||||
result = sameChildrenAux(a, b, c) and sameFlags(a, b)
|
||||
if result and {ExactGenericParams, ExactTypeDescValues} * c.flags != {}:
|
||||
result = a.sym.position == b.sym.position
|
||||
of tyGenericInvocation, tyGenericBody, tySequence,
|
||||
tyOpenArray, tySet, tyRef, tyPtr, tyVar, tyLent, tySink, tyUncheckedArray,
|
||||
tyArray, tyProc, tyVarargs, tyOrdinal, tyTypeClasses, tyOpt, tyOwned:
|
||||
of tyBuiltInTypeClass:
|
||||
assert a.len == 1
|
||||
assert a[0].len == 0
|
||||
assert b.len == 1
|
||||
assert b[0].len == 0
|
||||
result = a[0].kind == b[0].kind
|
||||
of tyGenericInvocation, tyGenericBody, tySequence, tyOpenArray, tySet, tyRef,
|
||||
tyPtr, tyVar, tyLent, tySink, tyUncheckedArray, tyArray, tyProc, tyVarargs,
|
||||
tyOrdinal, tyCompositeTypeClass, tyUserTypeClass, tyUserTypeClassInst,
|
||||
tyAnd, tyOr, tyNot, tyAnything, tyOpt, tyOwned:
|
||||
cycleCheck()
|
||||
if a.kind == tyUserTypeClass and a.n != nil: return a.n == b.n
|
||||
result = sameChildrenAux(a, b, c)
|
||||
|
||||
Reference in New Issue
Block a user