summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-11-05 20:20:13 +0100
committerAndreas Rumpf <rumpf_a@web.de>2018-11-06 13:55:03 +0100
commitc735b75f6f9aa83d525c1cb819c8e6d83badc447 (patch)
tree6c1a4b887eda51c7cba52dc95ce3735bd47e9465
parent1fa22d4cfed734736e79572105a7730f1e0dbd5f (diff)
downloadNim-c735b75f6f9aa83d525c1cb819c8e6d83badc447.tar.gz
compiler cleanup: flag tfOldSchoolExprStmt is gone
-rw-r--r--changelog.md3
-rw-r--r--compiler/ast.nim3
-rw-r--r--compiler/parser.nim2
-rw-r--r--compiler/semtypes.nim2
-rw-r--r--compiler/sigmatch.nim9
5 files changed, 5 insertions, 14 deletions
diff --git a/changelog.md b/changelog.md
index 9c799a540..10d5510e6 100644
--- a/changelog.md
+++ b/changelog.md
@@ -12,7 +12,8 @@
   instead.
 
 - The OpenMP parallel iterator \``||`\` now supports any `#pragma omp directives`
-  and not just `#pragma omp parallel for`. See [OpenMP documentation](https://www.openmp.org/wp-content/uploads/OpenMP-4.5-1115-CPP-web.pdf).
+  and not just `#pragma omp parallel for`. See
+  [OpenMP documentation](https://www.openmp.org/wp-content/uploads/OpenMP-4.5-1115-CPP-web.pdf).
 
   The default annotation is `parallel for`, if you used OpenMP without annotation
   the change is transparent, if you used annotations you will have to prefix
diff --git a/compiler/ast.nim b/compiler/ast.nim
index bc54367f6..bb0f95acd 100644
--- a/compiler/ast.nim
+++ b/compiler/ast.nim
@@ -568,9 +568,6 @@ const
   tfUnion* = tfNoSideEffect
   tfGcSafe* = tfThread
   tfObjHasKids* = tfEnumHasHoles
-  tfOldSchoolExprStmt* = tfVarargs # for now used to distinguish \
-    # 'varargs[expr]' from 'varargs[untyped]'. Eventually 'expr' will be
-    # deprecated and this mess can be cleaned up.
   tfReturnsNew* = tfInheritable
   skError* = skUnknown
 
diff --git a/compiler/parser.nim b/compiler/parser.nim
index 1743372c2..6e83a6710 100644
--- a/compiler/parser.nim
+++ b/compiler/parser.nim
@@ -2232,8 +2232,6 @@ proc parseString*(s: string; cache: IdentCache; config: ConfigRef;
   stream.lineOffset = line
 
   var parser: TParser
-  # XXX for now the builtin 'parseStmt/Expr' functions do not know about strong
-  # spaces...
   parser.lex.errorHandler = errorHandler
   openParser(parser, AbsoluteFile filename, stream, cache, config)
 
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index b0b7178fa..83d48b1b9 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -1744,10 +1744,8 @@ proc processMagicType(c: PContext, m: PSym) =
       setMagicType(c.config, m, tyAnything, 0)
     else:
       setMagicType(c.config, m, tyExpr, 0)
-      if m.name.s == "expr": m.typ.flags.incl tfOldSchoolExprStmt
   of mStmt:
     setMagicType(c.config, m, tyStmt, 0)
-    if m.name.s == "stmt": m.typ.flags.incl tfOldSchoolExprStmt
   of mTypeDesc, mType:
     setMagicType(c.config, m, tyTypeDesc, 0)
     rawAddSon(m.typ, newTypeS(tyNone, c))
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index 4dc7690ef..74935721d 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -1210,9 +1210,7 @@ proc typeRelImpl(c: var TCandidate, f, aOrig: PType,
     if f.kind == tyVarargs:
       if tfVarargs in a.flags:
         return typeRel(c, f.base, a.lastSon)
-      if tfOldSchoolExprStmt in f.sons[0].flags:
-        if f.sons[0].kind == tyExpr: return
-      elif f.sons[0].kind == tyStmt: return
+      if f.sons[0].kind == tyStmt: return
 
     template matchArrayOrSeq(aBase: PType) =
       let ff = f.base
@@ -1758,7 +1756,7 @@ proc typeRelImpl(c: var TCandidate, f, aOrig: PType,
         result = isNone
 
   of tyStmt:
-    if aOrig != nil and tfOldSchoolExprStmt notin f.flags:
+    if aOrig != nil:
       put(c, f, aOrig)
     result = isGeneric
 
@@ -2215,8 +2213,7 @@ proc incrIndexType(t: PType) =
   inc t.sons[0].n.sons[1].intVal
 
 template isVarargsUntyped(x): untyped =
-  x.kind == tyVarargs and x.sons[0].kind == tyExpr and
-    tfOldSchoolExprStmt notin x.sons[0].flags
+  x.kind == tyVarargs and x.sons[0].kind == tyExpr
 
 proc matchesAux(c: PContext, n, nOrig: PNode,
                 m: var TCandidate, marker: var IntSet) =