summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rwxr-xr-xcompiler/lexer.nim5
-rwxr-xr-xcompiler/renderer.nim17
-rwxr-xr-xcompiler/wordrecg.nim5
3 files changed, 22 insertions, 5 deletions
diff --git a/compiler/lexer.nim b/compiler/lexer.nim
index 59e367962..abb25541b 100755
--- a/compiler/lexer.nim
+++ b/compiler/lexer.nim
@@ -43,7 +43,7 @@ type
     tkLambda, tkLet,
     tkMacro, tkMethod, tkMixin, tkMod, tkNil, tkNot, tkNotin, 
     tkObject, tkOf, tkOr, tkOut, 
-    tkProc, tkPtr, tkRaise, tkRef, tkReturn, tkShl, tkShr, tkStatic,
+    tkProc, tkPtr, tkRaise, tkRef, tkReturn, tkShared, tkShl, tkShr, tkStatic,
     tkTemplate, 
     tkTry, tkTuple, tkType, tkVar, tkWhen, tkWhile, tkWith, tkWithout, tkXor,
     tkYield, # end of keywords
@@ -78,7 +78,8 @@ const
     "lambda", "let", 
     "macro", "method", "mixin", "mod", 
     "nil", "not", "notin", "object", "of", "or", 
-    "out", "proc", "ptr", "raise", "ref", "return", "shl", "shr", "static",
+    "out", "proc", "ptr", "raise", "ref", "return", 
+    "shared", "shl", "shr", "static",
     "template", 
     "try", "tuple", "type", "var", "when", "while", "with", "without", "xor",
     "yield",
diff --git a/compiler/renderer.nim b/compiler/renderer.nim
index de642eccb..b9d522694 100755
--- a/compiler/renderer.nim
+++ b/compiler/renderer.nim
@@ -425,6 +425,8 @@ proc lsub(n: PNode): int =
   of nkTypeDef: result = lsons(n) + 3
   of nkOfInherit: result = lsub(n.sons[0]) + len("of_")
   of nkProcTy: result = lsons(n) + len("proc_")
+  of nkIteratorTy: result = lsons(n) + len("iterator_")
+  of nkSharedTy: result = lsons(n) + len("shared_")
   of nkEnumTy: 
     if sonsLen(n) > 0:
       result = lsub(n.sons[0]) + lcomma(n, 1) + len("enum_")
@@ -1025,7 +1027,20 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
       gsub(g, n.sons[1])
     else:
       put(g, tkProc, "proc")
-  of nkEnumTy: 
+  of nkIteratorTy:
+    if sonsLen(n) > 0:
+      putWithSpace(g, tkIterator, "iterator")
+      gsub(g, n.sons[0])
+      gsub(g, n.sons[1])
+    else:
+      put(g, tkIterator, "iterator")
+  of nkSharedTy:
+    if sonsLen(n) > 0:
+      putWithSpace(g, tkShared, "shared")
+      gsub(g, n.sons[0])
+    else:
+      put(g, tkShared, "shared")
+  of nkEnumTy:
     if sonsLen(n) > 0:
       putWithSpace(g, tkEnum, "enum")
       gsub(g, n.sons[0])
diff --git a/compiler/wordrecg.nim b/compiler/wordrecg.nim
index 1cc3269dd..3ad2f45ca 100755
--- a/compiler/wordrecg.nim
+++ b/compiler/wordrecg.nim
@@ -30,7 +30,7 @@ type
     wInclude, wInterface, wIs, wIsnot, wIterator, wLambda, wLet,
     wMacro, wMethod, wMixin, wMod, wNil, 
     wNot, wNotin, wObject, wOf, wOr, wOut, wProc, wPtr, wRaise, wRef, wReturn, 
-    wShl, wShr, wStatic, wTemplate, wTry, wTuple, wType, wVar, 
+    wShared, wShl, wShr, wStatic, wTemplate, wTry, wTuple, wType, wVar, 
     wWhen, wWhile, wWith, wWithout, wXor, wYield,
     
     wColon, wColonColon, wEquals, wDot, wDotDot,
@@ -108,7 +108,8 @@ const
     "lambda", "let",
     "macro", "method", "mixin", "mod", "nil", "not", "notin", 
     "object", "of", "or", 
-    "out", "proc", "ptr", "raise", "ref", "return", "shl", "shr", "static",
+    "out", "proc", "ptr", "raise", "ref", "return",
+    "shared", "shl", "shr", "static",
     "template", "try", "tuple", "type", "var", 
     "when", "while", "with", "without", "xor",
     "yield",