summary refs log tree commit diff stats
path: root/lib/core/macros.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/core/macros.nim')
-rwxr-xr-xlib/core/macros.nim18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim
index c5afcdf17..825979e27 100755
--- a/lib/core/macros.nim
+++ b/lib/core/macros.nim
@@ -36,8 +36,8 @@ type
     nnkMacroDef, nnkTemplateDef, nnkIteratorDef, nnkOfBranch, 

     nnkElifBranch, nnkExceptBranch, nnkElse, nnkMacroStmt, 

     nnkAsmStmt, nnkPragma, nnkIfStmt, nnkWhenStmt, 

-    nnkForStmt, nnkWhileStmt, nnkCaseStmt, 
-    nnkVarSection, nnkLetSection, nnkConstSection, 
+    nnkForStmt, nnkWhileStmt, nnkCaseStmt, 

+    nnkVarSection, nnkLetSection, nnkConstSection, 

     nnkConstDef, nnkTypeSection, nnkTypeDef, 

     nnkYieldStmt, nnkTryStmt, nnkFinally, nnkRaiseStmt, 

     nnkReturnStmt, nnkBreakStmt, nnkContinueStmt, nnkBlockStmt, 

@@ -45,8 +45,8 @@ type
     nnkIncludeStmt, nnkCommentStmt, nnkStmtListExpr, nnkBlockExpr, 

     nnkStmtListType, nnkBlockType, nnkTypeOfExpr, nnkObjectTy, 

     nnkTupleTy, nnkRecList, nnkRecCase, nnkRecWhen, 

-    nnkRefTy, nnkPtrTy, nnkVarTy, 
-    nnkConstTy, nnkMutableTy,
+    nnkRefTy, nnkPtrTy, nnkVarTy, 

+    nnkConstTy, nnkMutableTy,

     nnkDistinctTy, 

     nnkProcTy, nnkEnumTy, nnkEnumFieldDef, nnkReturnToken

   TNimNodeKinds* = set[TNimrodNodeKind]

@@ -187,6 +187,8 @@ proc toStrLit*(n: PNimrodNode): PNimrodNode {.compileTime.} =
   ## in a string literal node

   return newStrLitNode(repr(n))

 

+proc lineinfo*(n: PNimrodNode): string {.magic: "NLineInfo".}

+

 proc toLisp*(n: PNimrodNode): string {.compileTime.} =

   ## Convert the AST `n` to a human-readable string

   ##

@@ -228,11 +230,11 @@ proc parseStmt*(s: string): stmt {.magic: "ParseStmtToAst".}
   ## Compiles the passed string to its AST representation.

   ## Expects one or more statements.

 

-proc getAst*(macroOrTemplate: expr): expr {.magic: "ExpandMacroToAst".}

+proc getAst*(macroOrTemplate: expr): expr {.magic: "ExpandToAst".}

   ## Obtains the AST nodes returned from a macro or template invocation.

-  ## Example:
-  ## 
-  ## .. code-block:: nimrod
+  ## Example:

+  ## 

+  ## .. code-block:: nimrod

   ##

   ##   macro FooMacro() = 

   ##     var ast = getAst(BarTemplate())