You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -106,7 +115,9 @@ function (state::Delayed)(x::EXPR)
106
115
s0 =scopes(x, state)
107
116
resolve_ref(x, state)
108
117
118
+
old =flag!(state, x)
109
119
traverse(x, state)
120
+
state.flags = old
110
121
if state.scope != s0
111
122
for b invalues(state.scope.names)
112
123
infer_type_by_use(b, state.env)
@@ -139,13 +150,23 @@ function (state::ResolveOnly)(x::EXPR)
139
150
return state.scope
140
151
end
141
152
153
+
# feature flags that can disable or enable functionality further down in the CST
154
+
const NO_NEW_BINDINGS =0x1
155
+
156
+
functionflag!(state, x::EXPR)
157
+
old = state.flags
158
+
if CSTParser.ismacrocall(x) && (valof(x.args[1]) =="@."||valof(x.args[1]) =="@__dot__")
159
+
state.flags |= NO_NEW_BINDINGS
160
+
end
161
+
return old
162
+
end
142
163
143
164
"""
144
165
semantic_pass(file, modified_expr=nothing)
145
166
146
167
Performs a semantic pass across a project from the entry point `file`. A first pass traverses the top-level scope after which secondary passes handle delayed scopes (e.g. functions). These secondary passes can be, optionally, very light and only seek to resovle references (e.g. link symbols to bindings). This can be done by supplying a list of expressions on which the full secondary pass should be made (`modified_expr`), all others will receive the light-touch version.
0 commit comments