ValName: trim whitespace from symbol names
This commit is contained in:
parent
fef5054cec
commit
0111213bea
@ -16,7 +16,8 @@ object ValNameImpl
|
|||||||
if (s == `NoSymbol`) Nil else s +: allOwners(s.owner)
|
if (s == `NoSymbol`) Nil else s +: allOwners(s.owner)
|
||||||
val terms = allOwners(c.internal.enclosingOwner).filter(_.isTerm).map(_.asTerm)
|
val terms = allOwners(c.internal.enclosingOwner).filter(_.isTerm).map(_.asTerm)
|
||||||
terms.filter(_.isVal).map(_.name.toString).find(_(0) != '$').map { s =>
|
terms.filter(_.isVal).map(_.name.toString).find(_(0) != '$').map { s =>
|
||||||
c.Expr[ValNameImpl] { q"_root_.freechips.rocketchip.macros.ValNameImpl(${s})" }
|
val trim = s.replaceAll("\\s", "")
|
||||||
|
c.Expr[ValNameImpl] { q"_root_.freechips.rocketchip.macros.ValNameImpl(${trim})" }
|
||||||
}.getOrElse(c.abort(c.enclosingPosition, "Not a valid application."))
|
}.getOrElse(c.abort(c.enclosingPosition, "Not a valid application."))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user