summary refs log tree commit diff stats
path: root/nim/semstmts.pas
diff options
context:
space:
mode:
authorrumpf_a@web.de <>2009-10-21 10:20:15 +0200
committerrumpf_a@web.de <>2009-10-21 10:20:15 +0200
commit053309e60aee1eda594a4817ac8ac2fb8c18fb04 (patch)
tree0f1ce8b0de0b493045eb97eeca6ebf06542de601 /nim/semstmts.pas
parent581572b28c65bc9fe47974cfd625210a69be0f3f (diff)
downloadNim-053309e60aee1eda594a4817ac8ac2fb8c18fb04.tar.gz
version 0.8.2
Diffstat (limited to 'nim/semstmts.pas')
-rwxr-xr-xnim/semstmts.pas18
1 files changed, 6 insertions, 12 deletions
diff --git a/nim/semstmts.pas b/nim/semstmts.pas
index b4b72a25b..1ece72023 100755
--- a/nim/semstmts.pas
+++ b/nim/semstmts.pas
@@ -127,7 +127,7 @@ var
   str, sub: string;
   a, b, c: int;
   e: PSym;
-  marker: Char;
+  marker: char;
 begin
   result := n;
   checkSonsLen(n, 2);
@@ -243,7 +243,7 @@ begin
   checkSonsLen(n, 2);
   a := n.sons[0];
   case a.kind of
-    nkDotExpr, nkQualified: begin
+    nkDotExpr: begin
       // r.f = x
       // --> `f=` (r, x)
       checkSonsLen(a, 2);
@@ -298,7 +298,8 @@ begin
   n.sons[1] := semExprWithType(c, n.sons[1]);
   le := n.sons[0].typ;
   if (skipTypes(le, {@set}[tyGenericInst]).kind <> tyVar) 
-  and not IsAssignable(n.sons[0]) then begin
+  and (IsAssignable(n.sons[0]) = arNone) then begin
+    // Direct assignment to a discriminant is allowed!
     liMessage(n.sons[0].info, errXCannotBeAssignedTo,
               renderTree(n.sons[0], {@set}[renderNoComments]));
   end
@@ -1014,8 +1015,7 @@ end;
 function evalInclude(c: PContext; n: PNode): PNode;
 var
   i, fileIndex: int;
-  x: PNode;
-  f, name, ext: string;
+  f: string;
 begin
   result := newNodeI(nkStmtList, n.info);
   addSon(result, n); // the rodwriter needs include information!
@@ -1024,13 +1024,7 @@ begin
     fileIndex := includeFilename(f);
     if IntSetContainsOrIncl(c.includedFiles, fileIndex) then
       liMessage(n.info, errRecursiveDependencyX, f);
-    SplitFilename(f, name, ext);
-    if cmpIgnoreCase(ext, '.'+TmplExt) = 0 then
-      x := gIncludeTmplFile(f)
-    else
-      x := gIncludeFile(f);
-    x := semStmt(c, x);
-    addSon(result, x);
+    addSon(result, semStmt(c, gIncludeFile(f)));
     IntSetExcl(c.includedFiles, fileIndex);
   end;
 end;