use 'using' instead of 'sig' keyword; cleans up new features a bit
This commit is contained in:
parent
554a3e9335
commit
c9966a3e17
20 changed files with 109 additions and 74 deletions
|
|
@ -460,9 +460,12 @@ proc lsub(n: PNode): int =
|
|||
else:
|
||||
result = len("enum")
|
||||
of nkEnumFieldDef: result = lsons(n) + 3
|
||||
of nkVarSection, nkLetSection, nkSigSection:
|
||||
of nkVarSection, nkLetSection:
|
||||
if sonsLen(n) > 1: result = MaxLineLen + 1
|
||||
else: result = lsons(n) + len("var_")
|
||||
of nkUsingStmt:
|
||||
if sonsLen(n) > 1: result = MaxLineLen + 1
|
||||
else: result = lsons(n) + len("using_")
|
||||
of nkReturnStmt: result = lsub(n.sons[0]) + len("return_")
|
||||
of nkRaiseStmt: result = lsub(n.sons[0]) + len("raise_")
|
||||
of nkYieldStmt: result = lsub(n.sons[0]) + len("yield_")
|
||||
|
|
@ -1173,12 +1176,12 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
|
|||
initContext(a)
|
||||
incl(a.flags, rfInConstExpr)
|
||||
gsection(g, n, a, tkConst, "const")
|
||||
of nkVarSection, nkLetSection, nkSigSection:
|
||||
of nkVarSection, nkLetSection, nkUsingStmt:
|
||||
var L = sonsLen(n)
|
||||
if L == 0: return
|
||||
if n.kind == nkVarSection: putWithSpace(g, tkVar, "var")
|
||||
elif n.kind == nkLetSection: putWithSpace(g, tkLet, "let")
|
||||
else: putWithSpace(g, tkSig, "sig")
|
||||
else: putWithSpace(g, tkUsing, "using")
|
||||
if L > 1:
|
||||
gcoms(g)
|
||||
indentNL(g)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue