summary refs log tree commit diff stats
path: root/compiler/semexprs.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/semexprs.nim')
-rwxr-xr-xcompiler/semexprs.nim32
1 files changed, 15 insertions, 17 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 35fb793c4..a7b35f08b 100755
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -501,14 +501,17 @@ proc semEcho(c: PContext, n: PNode): PNode =
     n.sons[i] = semExpr(c, buildStringify(c, arg))
   result = n
 
+proc lookUpForDefined(c: PContext, i: PIdent, onlyCurrentScope: bool): PSym =
+  if onlyCurrentScope: 
+    result = SymtabLocalGet(c.tab, i)
+  else: 
+    result = SymtabGet(c.Tab, i) # no need for stub loading
+
 proc LookUpForDefined(c: PContext, n: PNode, onlyCurrentScope: bool): PSym = 
   case n.kind
   of nkIdent: 
-    if onlyCurrentScope: 
-      result = SymtabLocalGet(c.tab, n.ident)
-    else: 
-      result = SymtabGet(c.Tab, n.ident) # no need for stub loading
-  of nkDotExpr: 
+    result = LookupForDefined(c, n.ident, onlyCurrentScope)
+  of nkDotExpr:
     result = nil
     if onlyCurrentScope: return 
     checkSonsLen(n, 2)
@@ -522,9 +525,8 @@ proc LookUpForDefined(c: PContext, n: PNode, onlyCurrentScope: bool): PSym =
           result = StrTableGet(m.tab, ident)
       else: 
         GlobalError(n.sons[1].info, errIdentifierExpected, "")
-  of nkAccQuoted: 
-    checkSonsLen(n, 1)
-    result = lookupForDefined(c, n.sons[0], onlyCurrentScope)
+  of nkAccQuoted:
+    result = lookupForDefined(c, considerAcc(n), onlyCurrentScope)
   else: 
     GlobalError(n.info, errIdentifierExpected, renderTree(n))
     result = nil
@@ -955,17 +957,16 @@ proc semMacroStmt(c: PContext, n: PNode, semCheck = true): PNode =
   else: 
     GlobalError(n.info, errInvalidExpressionX, 
                 renderTree(a, {renderNoComments}))
-  
+
 proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = 
   result = n
-  if gCmd == cmdIdeTools: 
-    suggestExpr(c, n)
+  if gCmd == cmdIdeTools: suggestExpr(c, n)
   if nfSem in n.flags: return 
-  case n.kind                 # atoms:
-  of nkIdent: 
+  case n.kind
+  of nkIdent, nkAccQuoted:
     var s = lookUp(c, n)
     result = semSym(c, n, s, flags)
-  of nkSym: 
+  of nkSym:
     # because of the changed symbol binding, this does not mean that we
     # don't have to check the symbol for semantics here again!
     result = semSym(c, n, n.sym, flags)
@@ -1062,9 +1063,6 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
     checkSonsLen(n, 1)
     n.sons[0] = semExpr(c, n.sons[0], flags)
   of nkCast: result = semCast(c, n)
-  of nkAccQuoted: 
-    checkSonsLen(n, 1)
-    result = semExpr(c, n.sons[0])
   of nkIfExpr: result = semIfExpr(c, n)
   of nkStmtListExpr: result = semStmtListExpr(c, n)
   of nkBlockExpr: result = semBlockExpr(c, n)
ubx?h=main&id=333525360b22f3d3ea31db46a4d2f1b4edbfebdb'>33352536 ^
6030d7e2 ^
80b6f47e ^
57628c0e ^
71eb22a5 ^
7a583220 ^
33352536 ^

ee9a9237 ^
33352536 ^







6030d7e2 ^
9d27e966 ^
ee9a9237 ^
6030d7e2 ^

ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
33352536 ^
9d27e966 ^
6030d7e2 ^
9d27e966 ^
03d50cc8 ^
9d27e966 ^
ee9a9237 ^
33352536 ^

6030d7e2 ^
ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
33352536 ^
9d27e966 ^
ee9a9237 ^
6030d7e2 ^

ee9a9237 ^
6030d7e2 ^
ee9a9237 ^
33352536 ^
03d50cc8 ^
6030d7e2 ^
03d50cc8 ^
ee9a9237 ^
33352536 ^


7a583220 ^
33352536 ^

6030d7e2 ^
57628c0e ^


e0ffdcd1 ^

f1eade72 ^
71eb22a5 ^
9b16f190 ^
6030d7e2 ^

4224ec81 ^
e0ffdcd1 ^
2a2a5b1e ^
9b16f190 ^
15ae0717 ^
a9d473e2 ^
f1eade72 ^
71eb22a5 ^
a9d473e2 ^




f1eade72 ^
71eb22a5 ^
a9d473e2 ^



ee9a9237 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107