nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests: add tests for multi-iterators
[nit.git]
/
src
/
metrics
/
ast_metrics.nit
diff --git
a/src/metrics/ast_metrics.nit
b/src/metrics/ast_metrics.nit
index
d66115e
..
d34899e
100644
(file)
--- a/
src/metrics/ast_metrics.nit
+++ b/
src/metrics/ast_metrics.nit
@@
-16,12
+16,10
@@
# Metrics about the nodes and identifiers in the AST
module ast_metrics
# Metrics about the nodes and identifiers in the AST
module ast_metrics
-import modelbuilder
-private import metrics_base
-import frontend
+import metrics_base
redef class ToolContext
redef class ToolContext
- var ast_metrics_phase = new AstMetricsPhase(self, null)
+ var ast_metrics_phase: Phase = new AstMetricsPhase(self, null)
end
private class AstMetricsPhase
end
private class AstMetricsPhase
@@
-29,7
+27,7
@@
private class AstMetricsPhase
var node_counter = new Counter[String]
var id_counter = new Counter[String]
var node_counter = new Counter[String]
var id_counter = new Counter[String]
- redef fun process_mainmodule(mainmodule)
+ redef fun process_mainmodule(mainmodule, given_mmodules)
do
if not toolcontext.opt_ast.value and not toolcontext.opt_all.value then return
print "--- AST Metrics ---"
do
if not toolcontext.opt_ast.value and not toolcontext.opt_all.value then return
print "--- AST Metrics ---"
@@
-55,7
+53,6
@@
private class AstMetricsVisitor
redef fun visit(n)
do
redef fun visit(n)
do
- if n == null then return
n.visit_all(self)
phase.node_counter.inc(n.class_name)
if n isa TId or n isa TAttrid or n isa TClassid then
n.visit_all(self)
phase.node_counter.inc(n.class_name)
if n isa TId or n isa TAttrid or n isa TClassid then