fun do_typing(tc: ToolContext)
do
var tv = new TypingVisitor(tc, self)
- tv.visit(node)
+ tv.enter_visit(node)
end
end
v.variable_ctx.already_unreash = true
v.warning(e, "Warning: unreachable statement.")
end
- v.visit(e)
+ v.enter_visit(e)
end
old_var_ctx.merge(v.variable_ctx)
redef fun accept_typing(v)
do
var old_var_ctx = v.variable_ctx
- v.visit(n_expr)
+ v.enter_visit(n_expr)
v.check_conform_expr(n_expr, v.type_bool)
# Prepare 'then' context
# Process the 'then'
if n_then != null then
v.variable_ctx = v.variable_ctx.sub(n_then.as(not null))
- v.visit(n_then)
+ v.enter_visit(n_then)
end
# Remember what appened in the 'then'
# Process the 'else'
if n_else != null then
v.variable_ctx = v.variable_ctx.sub(n_else.as(not null))
- v.visit(n_else)
+ v.enter_visit(n_else)
end
# Merge 'then' and 'else' contexts
v.variable_ctx = v.variable_ctx.sub(self)
# Process condition
- v.visit(n_expr)
+ v.enter_visit(n_expr)
v.check_conform_expr(n_expr, v.type_bool)
# Prepare inside context (assert cond)
# Process inside
if n_block != null then
v.variable_ctx = v.variable_ctx.sub(n_block.as(not null))
- v.visit(n_block)
+ v.enter_visit(n_block)
end
v.variable_ctx = old_var_ctx
_variable = va
v.variable_ctx.add(va)
- v.visit(n_expr)
+ v.enter_visit(n_expr)
if not v.check_conform_expr(n_expr, v.type_collection) then return
var expr_type = n_expr.stype
if not n_expr.is_self then t = t.not_for_self
va.stype = t
- if n_block != null then v.visit(n_block)
+ if n_block != null then v.enter_visit(n_block)
# pop context
v.variable_ctx = old_var_ctx
do
var old_var_ctx = v.variable_ctx
- v.visit(n_expr)
+ v.enter_visit(n_expr)
v.use_if_true_variable_ctx(n_expr)
- v.visit(n_then)
+ v.enter_visit(n_then)
v.variable_ctx = old_var_ctx
v.use_if_false_variable_ctx(n_expr)
- v.visit(n_else)
+ v.enter_visit(n_else)
v.check_conform_expr(n_expr, v.type_bool)
do
var old_var_ctx = v.variable_ctx
- v.visit(n_expr)
+ v.enter_visit(n_expr)
v.use_if_false_variable_ctx(n_expr)
- v.visit(n_expr2)
+ v.enter_visit(n_expr2)
if n_expr2.if_false_variable_ctx != null then
_if_false_variable_ctx = n_expr2.if_false_variable_ctx
else
do
var old_var_ctx = v.variable_ctx
- v.visit(n_expr)
+ v.enter_visit(n_expr)
v.use_if_true_variable_ctx(n_expr)
- v.visit(n_expr2)
+ v.enter_visit(n_expr2)
if n_expr2.if_true_variable_ctx != null then
_if_true_variable_ctx = n_expr2.if_true_variable_ctx
else