diff options
| author | Kamyar Mohajerani | 2016-07-21 23:40:34 +0430 |
|---|---|---|
| committer | Jack Koenig | 2016-07-21 12:10:34 -0700 |
| commit | ab340febdc7a5418da945f9b79624d36e66e26db (patch) | |
| tree | 04e4aef30081fdd419281d69be4b141fd49b4b1f /src/main/scala/firrtl/Utils.scala | |
| parent | b7de40e23161a7346fea90576f07b5c200c2675b (diff) | |
Indentation support for the ANTLR parser (as discussed in #192) (#194)
Indentation support for the ANTLR parser
- some clean-up of the parser code (TODO: file input could be improved, more clean-up)
- get rid of Translator and specify all syntactic rules in antlr4 grammer
- support for else-when shorthand in the grammar
- rename Begin to Block which makes more sense
Diffstat (limited to 'src/main/scala/firrtl/Utils.scala')
| -rw-r--r-- | src/main/scala/firrtl/Utils.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/scala/firrtl/Utils.scala b/src/main/scala/firrtl/Utils.scala index a5253e84..2053a70d 100644 --- a/src/main/scala/firrtl/Utils.scala +++ b/src/main/scala/firrtl/Utils.scala @@ -458,7 +458,7 @@ object Utils extends LazyLogging { case s:IsInvalid => s.info case s:Stop => s.info case s:Print => s.info - case s:Begin => NoInfo + case s:Block => NoInfo case EmptyStmt => NoInfo } } @@ -484,7 +484,7 @@ object Utils extends LazyLogging { case s:DefNode => MALE case s:DefInstance => MALE case s:DefMemory => MALE - case s:Begin => UNKNOWNGENDER + case s:Block => UNKNOWNGENDER case s:Connect => UNKNOWNGENDER case s:PartialConnect => UNKNOWNGENDER case s:Stop => UNKNOWNGENDER @@ -630,7 +630,7 @@ object Utils extends LazyLogging { case (None, Some(decl)) => Some(decl) case (None, None) => None } - case begin: Begin => + case begin: Block => val stmts = begin.stmts flatMap getRootDecl(name) // can we short circuit? if (stmts.nonEmpty) Some(stmts.head) else None case _ => None |
