render typeof as typeof
This commit is contained in:
parent
5be8e0b088
commit
9d000c519a
1 changed files with 2 additions and 2 deletions
|
|
@ -474,7 +474,7 @@ proc lsub(g: TSrcGen; n: PNode): int =
|
||||||
len("if_:_")
|
len("if_:_")
|
||||||
of nkElifExpr: result = lsons(g, n) + len("_elif_:_")
|
of nkElifExpr: result = lsons(g, n) + len("_elif_:_")
|
||||||
of nkElseExpr: result = lsub(g, n.sons[0]) + len("_else:_") # type descriptions
|
of nkElseExpr: result = lsub(g, n.sons[0]) + len("_else:_") # type descriptions
|
||||||
of nkTypeOfExpr: result = (if n.len > 0: lsub(g, n.sons[0]) else: 0)+len("type()")
|
of nkTypeOfExpr: result = (if n.len > 0: lsub(g, n.sons[0]) else: 0)+len("typeof()")
|
||||||
of nkRefTy: result = (if n.len > 0: lsub(g, n.sons[0])+1 else: 0) + len("ref")
|
of nkRefTy: result = (if n.len > 0: lsub(g, n.sons[0])+1 else: 0) + len("ref")
|
||||||
of nkPtrTy: result = (if n.len > 0: lsub(g, n.sons[0])+1 else: 0) + len("ptr")
|
of nkPtrTy: result = (if n.len > 0: lsub(g, n.sons[0])+1 else: 0) + len("ptr")
|
||||||
of nkVarTy: result = (if n.len > 0: lsub(g, n.sons[0])+1 else: 0) + len("var")
|
of nkVarTy: result = (if n.len > 0: lsub(g, n.sons[0])+1 else: 0) + len("var")
|
||||||
|
|
@ -1195,7 +1195,7 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
|
||||||
putWithSpace(g, tkColon, ":")
|
putWithSpace(g, tkColon, ":")
|
||||||
gsub(g, n, 0)
|
gsub(g, n, 0)
|
||||||
of nkTypeOfExpr:
|
of nkTypeOfExpr:
|
||||||
put(g, tkType, "type")
|
put(g, tkType, "typeof")
|
||||||
put(g, tkParLe, "(")
|
put(g, tkParLe, "(")
|
||||||
if n.len > 0: gsub(g, n.sons[0])
|
if n.len > 0: gsub(g, n.sons[0])
|
||||||
put(g, tkParRi, ")")
|
put(g, tkParRi, ")")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue