nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
model: add `MEntity::is_broken`
[nit.git]
/
src
/
transform.nit
diff --git
a/src/transform.nit
b/src/transform.nit
index
118142a
..
58541c2
100644
(file)
--- a/
src/transform.nit
+++ b/
src/transform.nit
@@
-20,12
+20,13
@@
import astbuilder
import astvalidation
import semantize
intrude import semantize::scope
import astvalidation
import semantize
intrude import semantize::scope
+intrude import semantize::typing
redef class ToolContext
var transform_phase: Phase = new TransformPhase(self, [typing_phase, auto_super_init_phase])
# --no-shortcut-range
redef class ToolContext
var transform_phase: Phase = new TransformPhase(self, [typing_phase, auto_super_init_phase])
# --no-shortcut-range
- var opt_no_shortcut_range: OptionBool = new OptionBool("Always insantiate a range and its iterator on 'for' loops", "--no-shortcut-range")
+ var opt_no_shortcut_range: OptionBool = new OptionBool("Always instantiate a range and its iterator on 'for' loops", "--no-shortcut-range")
redef init
do
redef init
do
@@
-103,7
+104,20
@@
redef class AExpr
var nadd = v.builder.make_call(recv, na.push_callsite.as(not null), [self])
place.replace_with(nadd)
end
var nadd = v.builder.make_call(recv, na.push_callsite.as(not null), [self])
place.replace_with(nadd)
end
+
+ visit_all(v)
+
+ if is_broken then return # Skip broken
+
+ accept_transform_visitor(v)
+ end
+
+ redef fun replace_with(other)
+ do
super
super
+ if other isa AExpr then
+ if other.implicit_cast_to == null then other.implicit_cast_to = implicit_cast_to
+ end
end
end
end
end
@@
-347,6
+361,8
@@
redef class AArrayExpr
# ~~~
redef fun full_transform_visitor(v)
do
# ~~~
redef fun full_transform_visitor(v)
do
+ if is_broken then return # Skip broken
+
var nblock = v.builder.make_block
var nnew = v.builder.make_new(with_capacity_callsite.as(not null), [v.builder.make_int(n_exprs.length)])
var nblock = v.builder.make_block
var nnew = v.builder.make_new(with_capacity_callsite.as(not null), [v.builder.make_int(n_exprs.length)])