diff options
| author | Adam Izraelevitz | 2017-03-03 17:04:43 -0800 |
|---|---|---|
| committer | Adam Izraelevitz | 2017-03-06 16:48:15 -0800 |
| commit | fa4922dd3d985350fbc30281f6ffcf6e05c542ad (patch) | |
| tree | 1ba8ac3195806c5684a2ac2fbedf724ca056819a /src/main/scala/firrtl/Parser.scala | |
| parent | b5ef5b876d4f4ad4a17bc81362b2264970272d63 (diff) | |
Added more stylized debugging style
Diffstat (limited to 'src/main/scala/firrtl/Parser.scala')
| -rw-r--r-- | src/main/scala/firrtl/Parser.scala | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/scala/firrtl/Parser.scala b/src/main/scala/firrtl/Parser.scala index 5f0e682d..f40c465e 100644 --- a/src/main/scala/firrtl/Parser.scala +++ b/src/main/scala/firrtl/Parser.scala @@ -26,7 +26,7 @@ object Parser extends LazyLogging { /** Takes Iterator over lines of FIRRTL, returns FirrtlNode (root node is Circuit) */ def parse(lines: Iterator[String], infoMode: InfoMode = UseInfo): Circuit = { - val cst = time("ANTLR Parser") { + val (parseTimeMillis, cst) = time { val parser = { import scala.collection.JavaConverters._ val inStream = new SequenceInputStream( @@ -47,9 +47,10 @@ object Parser extends LazyLogging { } val visitor = new Visitor(infoMode) - val ast = time("Visitor") { + val (visitTimeMillis, visit) = time { visitor.visit(cst) - } match { + } + val ast = visit match { case c: Circuit => c case x => throw new ClassCastException("Error! AST not rooted with Circuit node!") } |
