-
Notifications
You must be signed in to change notification settings - Fork 177
Should a MultiInfo be recovered when serializing and parsing? #1695
Comments
Going one step further: If this is the desired behavior, why don't we get rid of the // current implementation
def ++(that: Info): Info = if (that == NoInfo) this else MultiInfo(Seq(this, that))
// suggested implementation:
def ++(that: Info): Info = that match {
case NoInfo => this
case FileInfo(escapedThat) => FileInfo(escaped + " " + escapedThat)
} |
As an alternative, if we want to keep the Strings separate until right before serialization, we could change |
As discussed in the dev meeting, this issue is on hold until @jackkoenig has time to revamp the whole Info system. |
I think the answer to your question "Should a MultiInfo be recovered when serializing and parsing?" is "yes", it's just a question of how exactly to do it. I don't think we should concatenate into a single FileInfo because of the tendency of multiple FIRRTL nodes with the same source locator being collapsed. I'm not sure of the right way to represent Multi-Info in the serialized form but it's definitely a problem worth solving. Perhaps having the proposed |
|
Pedantically, A perhaps naive approach would be to go to URIs/URLs to represent the file. This should make spaces actually work as identifiers here. Java seems to let you go back and forth pretty easy:
|
Yes, but then it would be encoded as |
Currently a
MultiInfo
gets serialized in such a way that it is impossible to recover:serializes to
@[a b c]
which is then parsed asFileInfo("a b c")
.Is this the expected behavior?
The text was updated successfully, but these errors were encountered: