mirror of https://github.com/sbt/sbt.git
There have been numerous issues with the multi parser incorrectly splitting commands like `alias foo = ; bar` into `"alias foo =" :: "bar" :: Nil`. To fix this, I update the multi parser implementation to accept a list of commands that cannot be part of a multi command. For now, the only excluded command is "alias", but if other issues come up, we can add more. I also thought about adding a system property for excluding more commands but it didn't seem worth the maintenance cost at this point. In addition to adding a filter for the excluded commands, I also reworked the multi parser so that I think its more clear (and should hopefully have more predictable performance). I changed the cmdPart parser to accept empty strings. Prior to this, the parser explicitly handled the non-leading semicolon and leading semicolon cases separately. With the relaxed cmdPart, we can handle both cases with a single parser. We just have to strip any empty commands at the beginning or end of the command list. |
||
|---|---|---|
| .. | ||
| internal | ||
| MultiParserSpec.scala | ||