From 18d5154c83f9af99ff0c90d6b2c1329af4f1a949 Mon Sep 17 00:00:00 2001 From: edwardcwang Date: Fri, 10 Apr 2020 17:26:47 +0000 Subject: Support infoMode for Strings (#782) * Support infoMode for Strings It seemed like an API hole that I couldn't use infoMode with a string but had to manually create an iterator first. * Fix build error Co-authored-by: Jim Lawson --- src/main/scala/firrtl/Parser.scala | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/main/scala/firrtl/Parser.scala b/src/main/scala/firrtl/Parser.scala index 0388c453..d3075cbb 100644 --- a/src/main/scala/firrtl/Parser.scala +++ b/src/main/scala/firrtl/Parser.scala @@ -104,6 +104,10 @@ object Parser extends LazyLogging { circuit.modules.head.ports.head.tpe } + def parse(lines: Seq[String], infoMode: InfoMode): Circuit = parse(lines.iterator, infoMode) + + def parse(text: String, infoMode: InfoMode): Circuit = parse(text split "\n", infoMode) + /** Parse the concrete syntax of a FIRRTL [[firrtl.ir.Expression]], e.g. * "add(x, y)" becomes: * {{{ -- cgit v1.2.3