some progress for jester+async
This commit is contained in:
parent
85a1d896c2
commit
7014d0c5c8
12 changed files with 7587 additions and 29 deletions
|
|
@ -111,13 +111,28 @@ proc indirectAccess*(a: PNode, b: string, info: TLineInfo): PNode =
|
|||
t = t.sons[0]
|
||||
if t == nil: break
|
||||
t = t.skipTypes(abstractInst)
|
||||
assert field != nil, b
|
||||
#if field == nil:
|
||||
# debug deref.typ
|
||||
# echo deref.typ.id
|
||||
internalAssert field != nil, b
|
||||
addSon(deref, a)
|
||||
result = newNodeI(nkDotExpr, info)
|
||||
addSon(result, deref)
|
||||
addSon(result, newSymNode(field))
|
||||
result.typ = field.typ
|
||||
|
||||
proc getFieldFromObj*(t: PType; v: PSym): PSym =
|
||||
assert v.kind != skField
|
||||
let fieldName = getIdent(v.name.s & $v.id)
|
||||
var t = t
|
||||
while true:
|
||||
assert t.kind == tyObject
|
||||
result = getSymFromList(t.n, fieldName)
|
||||
if result != nil: break
|
||||
t = t.sons[0]
|
||||
if t == nil: break
|
||||
t = t.skipTypes(abstractInst)
|
||||
|
||||
proc indirectAccess*(a: PNode, b: PSym, info: TLineInfo): PNode =
|
||||
# returns a[].b as a node
|
||||
result = indirectAccess(a, b.name.s & $b.id, info)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue