summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-11-21 11:27:24 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-11-21 11:27:35 +0100
commitcae5e33a4a66406813769361233438c7d2df6009 (patch)
treebdba5c64996a0bec5ba764d98e26fb11e94b65d3 /compiler
parent58187f212067beff458e76d7c819750a9cfa100c (diff)
downloadNim-cae5e33a4a66406813769361233438c7d2df6009.tar.gz
language change: 'generic' and 'atomic' are not keywords anymore
Diffstat (limited to 'compiler')
-rw-r--r--compiler/lexer.nim8
-rw-r--r--compiler/parser.nim6
-rw-r--r--compiler/semtypes.nim2
-rw-r--r--compiler/wordrecg.nim8
4 files changed, 9 insertions, 15 deletions
diff --git a/compiler/lexer.nim b/compiler/lexer.nim
index 2ae2176de..4106494c4 100644
--- a/compiler/lexer.nim
+++ b/compiler/lexer.nim
@@ -33,13 +33,13 @@ type
   TTokType* = enum
     tkInvalid, tkEof,         # order is important here!
     tkSymbol, # keywords:
-    tkAddr, tkAnd, tkAs, tkAsm, tkAtomic,
+    tkAddr, tkAnd, tkAs, tkAsm,
     tkBind, tkBlock, tkBreak, tkCase, tkCast,
     tkConcept, tkConst, tkContinue, tkConverter,
     tkDefer, tkDiscard, tkDistinct, tkDiv, tkDo,
     tkElif, tkElse, tkEnd, tkEnum, tkExcept, tkExport,
     tkFinally, tkFor, tkFrom, tkFunc,
-    tkGeneric, tkIf, tkImport, tkIn, tkInclude, tkInterface,
+    tkIf, tkImport, tkIn, tkInclude, tkInterface,
     tkIs, tkIsnot, tkIterator,
     tkLet,
     tkMacro, tkMethod, tkMixin, tkMod, tkNil, tkNot, tkNotin,
@@ -75,12 +75,12 @@ const
   tokKeywordHigh* = pred(tkIntLit)
   TokTypeToStr*: array[TTokType, string] = ["tkInvalid", "[EOF]",
     "tkSymbol",
-    "addr", "and", "as", "asm", "atomic",
+    "addr", "and", "as", "asm",
     "bind", "block", "break", "case", "cast",
     "concept", "const", "continue", "converter",
     "defer", "discard", "distinct", "div", "do",
     "elif", "else", "end", "enum", "except", "export",
-    "finally", "for", "from", "func", "generic", "if",
+    "finally", "for", "from", "func", "if",
     "import", "in", "include", "interface", "is", "isnot", "iterator",
     "let",
     "macro", "method", "mixin", "mod",
diff --git a/compiler/parser.nim b/compiler/parser.nim
index 41303ead9..b1cfd7609 100644
--- a/compiler/parser.nim
+++ b/compiler/parser.nim
@@ -1140,13 +1140,9 @@ proc primary(p: var TParser, mode: TPrimaryMode): PNode =
     else:
       result = newNodeP(nkObjectTy, p)
       getTok(p)
-  of tkGeneric, tkConcept:
+  of tkConcept:
     if mode == pmTypeDef:
-      let wasGeneric = p.tok.tokType == tkGeneric
       result = parseTypeClass(p)
-      # hack so that it's remembered and can be marked as deprecated in
-      # sem'check:
-      if wasGeneric: result.flags.incl nfBase2
     else:
       parMessage(p, errInvalidToken, p.tok)
   of tkStatic:
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index b032557b7..b2c6efc37 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -1218,8 +1218,6 @@ template modifierTypeKindOfNode(n: PNode): TTypeKind =
 
 proc semTypeClass(c: PContext, n: PNode, prev: PType): PType =
   # if n.sonsLen == 0: return newConstraint(c, tyTypeClass)
-  if nfBase2 in n.flags:
-    message(n.info, warnDeprecated, "use 'concept' instead; 'generic'")
   let
     pragmas = n[1]
     inherited = n[2]
diff --git a/compiler/wordrecg.nim b/compiler/wordrecg.nim
index f5ba35dfb..8881acadd 100644
--- a/compiler/wordrecg.nim
+++ b/compiler/wordrecg.nim
@@ -21,11 +21,11 @@ type
   TSpecialWord* = enum
     wInvalid,
 
-    wAddr, wAnd, wAs, wAsm, wAtomic,
+    wAddr, wAnd, wAs, wAsm,
     wBind, wBlock, wBreak, wCase, wCast, wConcept, wConst,
     wContinue, wConverter, wDefer, wDiscard, wDistinct, wDiv, wDo,
     wElif, wElse, wEnd, wEnum, wExcept, wExport,
-    wFinally, wFor, wFrom, wFunc, wGeneric, wIf, wImport, wIn,
+    wFinally, wFor, wFrom, wFunc, wIf, wImport, wIn,
     wInclude, wInterface, wIs, wIsnot, wIterator, wLet,
     wMacro, wMethod, wMixin, wMod, wNil,
     wNot, wNotin, wObject, wOf, wOr, wOut, wProc, wPtr, wRaise, wRef, wReturn,
@@ -103,12 +103,12 @@ const
 
   specialWords*: array[low(TSpecialWord)..high(TSpecialWord), string] = ["",
 
-    "addr", "and", "as", "asm", "atomic",
+    "addr", "and", "as", "asm",
     "bind", "block", "break", "case", "cast",
     "concept", "const", "continue", "converter",
     "defer", "discard", "distinct", "div", "do",
     "elif", "else", "end", "enum", "except", "export",
-    "finally", "for", "from", "func", "generic", "if",
+    "finally", "for", "from", "func", "if",
     "import", "in", "include", "interface", "is", "isnot", "iterator",
     "let",
     "macro", "method", "mixin", "mod", "nil", "not", "notin",