diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-02-29 12:19:54 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-02-29 12:19:54 +0100 |
commit | c9966a3e178bc5bc21684d3f4f65c8580227d2f4 (patch) | |
tree | 577e3591910d082265e623830f6a269c58340411 /compiler/renderer.nim | |
parent | 554a3e9335fddac4656a9313ab283ae0e4d14a9e (diff) | |
download | Nim-c9966a3e178bc5bc21684d3f4f65c8580227d2f4.tar.gz |
use 'using' instead of 'sig' keyword; cleans up new features a bit
Diffstat (limited to 'compiler/renderer.nim')
-rw-r--r-- | compiler/renderer.nim | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/renderer.nim b/compiler/renderer.nim index 2b552f130..12852ba3d 100644 --- a/compiler/renderer.nim +++ b/compiler/renderer.nim @@ -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) |