syntax compatibility between do blocks and stmt blocks
See the section `do notation` in the manual for more info. * nkMacroStmt has been removed Macro statements are now mapped to regular nkCall nodes. The support for additional clauses (such as else, except, of, etc) have been restored - they will now appear as additional arguments for the nkCall node (as nkElse, nkExcept, etc nodes) * fixed some regressions in the `is` operator and semCompiles
This commit is contained in:
parent
a6d5707faf
commit
d9d82fb0af
21 changed files with 142 additions and 168 deletions
|
|
@ -145,7 +145,6 @@ type
|
|||
nkElifBranch, # used in if statements
|
||||
nkExceptBranch, # an except section
|
||||
nkElse, # an else part
|
||||
nkMacroStmt, # a macro statement
|
||||
nkAsmStmt, # an assembler block
|
||||
nkPragma, # a pragma statement
|
||||
nkPragmaBlock, # a pragma with a block
|
||||
|
|
@ -911,6 +910,18 @@ proc newMetaNodeIT*(tree: PNode, info: TLineInfo, typ: PType): PNode =
|
|||
result = newNodeIT(nkMetaNode, info, typ)
|
||||
result.add(tree)
|
||||
|
||||
var emptyParams = newNode(nkFormalParams)
|
||||
emptyParams.addSon(emptyNode)
|
||||
|
||||
proc newProcNode*(kind: TNodeKind, info: TLineInfo, body: PNode,
|
||||
params = emptyParams,
|
||||
name, pattern, genericParams,
|
||||
pragmas, exceptions = ast.emptyNode): PNode =
|
||||
result = newNodeI(kind, info)
|
||||
result.sons = @[name, pattern, genericParams, params,
|
||||
pragmas, exceptions, body]
|
||||
|
||||
|
||||
proc NewType(kind: TTypeKind, owner: PSym): PType =
|
||||
new(result)
|
||||
result.kind = kind
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue