From 2c449c5d6e23dcbb60e8c64cab6b6f4ba6ae313f Mon Sep 17 00:00:00 2001 From: Jim Lawson Date: Mon, 18 Mar 2019 12:17:33 -0700 Subject: Split #974 into two PRs - scalastyle updates (#1037) * Update style warnings now that subprojects are aggregated. Use "scalastyle-test-config.xml" for scalastyle config in tests. Enable "_" in method names and accept method names ending in "_=". Re-sync scalastyle-test-config.xml with scalastyle-config.xml * Remove bogus tests that crept in with git add * Add missing import. --- chiselFrontend/src/main/scala/chisel3/core/When.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'chiselFrontend/src/main/scala/chisel3/core/When.scala') diff --git a/chiselFrontend/src/main/scala/chisel3/core/When.scala b/chiselFrontend/src/main/scala/chisel3/core/When.scala index fb246e1b..78fc0fc5 100644 --- a/chiselFrontend/src/main/scala/chisel3/core/When.scala +++ b/chiselFrontend/src/main/scala/chisel3/core/When.scala @@ -28,11 +28,11 @@ object when { // scalastyle:ignore object.name * }}} */ - def apply(cond: => Bool)(block: => Unit)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): WhenContext = { + def apply(cond: => Bool)(block: => Unit)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): WhenContext = { // scalastyle:ignore line.size.limit new WhenContext(sourceInfo, Some(() => cond), block) } } - + /** A WhenContext may represent a when, and elsewhen, or an * otherwise. Since FIRRTL does not have an "elsif" statement, * alternatives must be mapped to nested if-else statements inside @@ -51,8 +51,8 @@ final class WhenContext(sourceInfo: SourceInfo, cond: Option[() => Bool], block: * declaration and assignment of the Bool node of the predicate in * the correct place. */ - def elsewhen (elseCond: => Bool)(block: => Unit)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): WhenContext = { - new WhenContext(sourceInfo, Some(() => elseCond), block, firrtlDepth+1) + def elsewhen (elseCond: => Bool)(block: => Unit)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): WhenContext = { // scalastyle:ignore line.size.limit + new WhenContext(sourceInfo, Some(() => elseCond), block, firrtlDepth + 1) } /** This block of logic gets executed only if the above conditions @@ -63,10 +63,10 @@ final class WhenContext(sourceInfo: SourceInfo, cond: Option[() => Bool], block: * place. */ def otherwise(block: => Unit)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Unit = - new WhenContext(sourceInfo, None, block, firrtlDepth+1) + new WhenContext(sourceInfo, None, block, firrtlDepth + 1) /* - * + * */ if (firrtlDepth > 0) { pushCommand(AltBegin(sourceInfo)) } cond.foreach( c => pushCommand(WhenBegin(sourceInfo, c().ref)) ) -- cgit v1.2.3