From c9966a3e178bc5bc21684d3f4f65c8580227d2f4 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Mon, 29 Feb 2016 12:19:54 +0100 Subject: use 'using' instead of 'sig' keyword; cleans up new features a bit --- compiler/renderer.nim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'compiler/renderer.nim') 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) -- cgit 1.4.1-2-gfad0