implemented 'import except'
This commit is contained in:
parent
0ef08e49e7
commit
92e10e4b18
14 changed files with 120 additions and 95 deletions
|
|
@ -1134,13 +1134,27 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
|
|||
put(g, tkCurlyDotLe, "{.")
|
||||
gcomma(g, n, emptyContext)
|
||||
put(g, tkCurlyDotRi, ".}")
|
||||
of nkImportStmt:
|
||||
putWithSpace(g, tkImport, "import")
|
||||
of nkImportStmt, nkExportStmt:
|
||||
if n.kind == nkImportStmt:
|
||||
putWithSpace(g, tkImport, "import")
|
||||
else:
|
||||
putWithSpace(g, tkExport, "export")
|
||||
gcoms(g)
|
||||
indentNL(g)
|
||||
gcommaAux(g, n, g.indent)
|
||||
dedent(g)
|
||||
putNL(g)
|
||||
of nkImportExceptStmt, nkExportExceptStmt:
|
||||
if n.kind == nkImportExceptStmt:
|
||||
putWithSpace(g, tkImport, "import")
|
||||
else:
|
||||
putWithSpace(g, tkExport, "export")
|
||||
gsub(g, n.sons[0])
|
||||
put(g, tkSpaces, Space)
|
||||
putWithSpace(g, tkExcept, "except")
|
||||
gcommaAux(g, n, g.indent, 1)
|
||||
gcoms(g)
|
||||
putNL(g)
|
||||
of nkFromStmt:
|
||||
putWithSpace(g, tkFrom, "from")
|
||||
gsub(g, n.sons[0])
|
||||
|
|
@ -1148,14 +1162,6 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
|
|||
putWithSpace(g, tkImport, "import")
|
||||
gcomma(g, n, emptyContext, 1)
|
||||
putNL(g)
|
||||
of nkImportExceptStmt:
|
||||
putWithSpace(g, tkImport, "import")
|
||||
gsub(g, n.sons[0])
|
||||
put(g, tkSpaces, Space)
|
||||
putWithSpace(g, tkExcept, "except")
|
||||
gcommaAux(g, n, g.indent, 1)
|
||||
gcoms(g)
|
||||
putNL(g)
|
||||
of nkIncludeStmt:
|
||||
putWithSpace(g, tkInclude, "include")
|
||||
gcoms(g)
|
||||
|
|
@ -1163,13 +1169,6 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
|
|||
gcommaAux(g, n, g.indent)
|
||||
dedent(g)
|
||||
putNL(g)
|
||||
of nkExportStmt:
|
||||
putWithSpace(g, tkExport, "export")
|
||||
gcoms(g)
|
||||
indentNL(g)
|
||||
gcommaAux(g, n, g.indent)
|
||||
dedent(g)
|
||||
putNL(g)
|
||||
of nkCommentStmt:
|
||||
gcoms(g)
|
||||
optNL(g)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue