summary refs log tree commit diff stats
path: root/compiler/ast.nim
diff options
context:
space:
mode:
authorAndrey Sobolev <andrey.sobolev@xored.com>2015-09-14 11:50:39 +0600
committerAndrey Sobolev <andrey.sobolev@xored.com>2015-09-14 11:50:39 +0600
commit2f6dc8c47f836b66c1a28fd0b90a9e591b6c9be5 (patch)
tree0676259b78fba9788d6dffd441de1d7f5b0df140 /compiler/ast.nim
parenta1aa7da37612eac6f961f0daaf5454f936b4e295 (diff)
parent148bbee05f31802666dbf1730e0df328ff57a384 (diff)
downloadNim-2f6dc8c47f836b66c1a28fd0b90a9e591b6c9be5.tar.gz
Merge remote-tracking branch 'nim-lang/devel' into emscripten-support
Diffstat (limited to 'compiler/ast.nim')
-rw-r--r--compiler/ast.nim10
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim
index 7b6f39cbc..860bf67e8 100644
--- a/compiler/ast.nim
+++ b/compiler/ast.nim
@@ -537,7 +537,7 @@ const
 type
   TMagic* = enum # symbols that require compiler magic:
     mNone,
-    mDefined, mDefinedInScope, mCompiles,
+    mDefined, mDefinedInScope, mCompiles, mArrGet, mArrPut, mAsgn,
     mLow, mHigh, mSizeOf, mTypeTrait, mIs, mOf, mAddr, mTypeOf, mRoof, mPlugin,
     mEcho, mShallowCopy, mSlurp, mStaticExec,
     mParseExprToAst, mParseStmtToAst, mExpandToAst, mQuoteAst,
@@ -614,6 +614,7 @@ const
   ctfeWhitelist* = {mNone, mUnaryLt, mSucc,
     mPred, mInc, mDec, mOrd, mLengthOpenArray,
     mLengthStr, mLengthArray, mLengthSeq, mXLenStr, mXLenSeq,
+    mArrGet, mArrPut, mAsgn,
     mIncl, mExcl, mCard, mChr,
     mAddI, mSubI, mMulI, mDivI, mModI,
     mAddF64, mSubF64, mMulF64, mDivF64,
@@ -1586,3 +1587,10 @@ proc createMagic*(name: string, m: TMagic): PSym =
 let
   opNot* = createMagic("not", mNot)
   opContains* = createMagic("contains", mInSet)
+
+when false:
+  proc containsNil*(n: PNode): bool =
+    # only for debugging
+    if n.isNil: return true
+    for i in 0 ..< n.safeLen:
+      if n[i].containsNil: return true