google / swift

The Swift Programming Language
https://swift.org/
840 stars 66 forks source link

Allow breaks to ignore discretionary newlines. #224

Closed allevato closed 5 years ago

allevato commented 5 years ago

Previously, discretionary newlines could appear anywhere that a break was allowed. Some breaks, however, exist only as "last resorts" to allow a line break to occur when there is no other way to break the tokens before it. To handle this, we add a flag to breaks that allows them to discard the user's newline unless that last resort behavior occurs.