mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Fix some bugs found via fuzzing
* Keywords need to still be recognized if they're followed by ',' as well as a bunch of other operator characters. Notably missing from this list is '-', since that would mess up expect-fx currently. * Smattering of niche cases of formatting bugs (either non-idempotency, leading to different code, or leading to unparsable code) * One missing indent call in fmt_collection leading to a panic
This commit is contained in:
parent
8fd83a483b
commit
550113df67
11 changed files with 152 additions and 6 deletions
|
@ -1056,7 +1056,11 @@ where
|
|||
// the next character should not be an identifier character
|
||||
// to prevent treating `whence` or `iffy` as keywords
|
||||
match state.bytes().get(width) {
|
||||
Some(next) if *next == b' ' || *next == b'#' || *next == b'\n' || *next == b'\r' => {
|
||||
Some(
|
||||
b' ' | b'#' | b'\n' | b'\r' | b'\t' | b',' | b'(' | b')' | b'[' | b']' | b'{'
|
||||
| b'}' | b'"' | b'\'' | b'/' | b'\\' | b'+' | b'*' | b'%' | b'^' | b'&' | b'|'
|
||||
| b'<' | b'>' | b'=' | b'!' | b'~' | b'`' | b';' | b':' | b'?' | b'.',
|
||||
) => {
|
||||
state = state.advance(width);
|
||||
Ok((MadeProgress, (), state))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue