-
Notifications
You must be signed in to change notification settings - Fork 177
Conditionals Syntactic Shorthands #192
Comments
@jackkoenig are there plans to support this in the Scala implementation? |
So it turns out that the shorthand for else-when chains is difficult to support in the current implementation of the parser. They were supported until recently, but I dropped them with the addition of source locators. The problem how do we correctly deal with source locators on shorthand when statements? ie.
So how do we do this on shorthand whens?
The main issue is not with the ANTLR-generated parser but with how this is handled in the preprocess step (ie. Translator). I do not have plans to add support in the short term because the Translator has been a real time sink. In my opinion, one of the following 3 things should happen:
In any of the above cases, these syntactical shorthands should be relatively easy to support although it is a reasonable question why shorthand is needed in an IR. For the record, register shorthand is supported because there's only 1 source locator so there was no ambiguity to deal with. |
Sounds like the plan is to support it eventually :) |
Hi, |
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
Implemented by adding a Boolean to check for alternating invocations of object Module.apply and the constructor of abstract class Module. Fixes #192
Current FIRRTL spec mentions a "syntactical shorthand" for else-when chains (in 5.9.1: Syntactic Shorthands) which is not supported by the current Scala implementation (I guess some of the other shorthands are not supported either). I was wondering if this is something which is planned to be implemented in the future or if it's probable that the spec is going to drop this altogether.
The text was updated successfully, but these errors were encountered: