An even more silly PR, but maybe a style question. Most of BNF's examples and tests use double quotes for the string literal of terminals. This leads to a lot of escaping, and takes more space than a single quote (\" vs ').
This PR changes examples and tests to use single quotes. I don't think this matters much, but it does look better to my arbitrary eyes/brain.
The one controversial part to his that I see is that the existing Display implementations default to double quotes. So users who call Grammar.to_string() or similar will see the terminals in double quotes.
An alternative to this PR would be to update examples / tests to use r# string literals. This would allow for double quotes, without the need to escape:
Coverage: 91.063%. Remained the same when pulling d6b52545369f85347dbb00b36aae4be8578c5b4c on prefer-single-quotes into 50cfb269e6c615832cd35fefddb3f6f93f5acf6a on main.
An even more silly PR, but maybe a style question. Most of BNF's examples and tests use double quotes for the string literal of terminals. This leads to a lot of escaping, and takes more space than a single quote (
\"
vs'
).This PR changes examples and tests to use single quotes. I don't think this matters much, but it does look better to my arbitrary eyes/brain.
The one controversial part to his that I see is that the existing
Display
implementations default to double quotes. So users who callGrammar.to_string()
or similar will see the terminals in double quotes.An alternative to this PR would be to update examples / tests to use
r#
string literals. This would allow for double quotes, without the need to escape:r#"<zip-part> ::= <town-name> "," <state-code> <ZIP-code> <EOL>"#