Gmail allows (or allowed) users to create flags containing some invalid atom-specials chars, such as "]" or SP. Ultimately, this isn't unambiguously parsable. But we can workaround it.
Prior to #212, the ResponseParser simply grabbed everything inside the parentheses and then scanned through with a very liberal "flag" regexp. This PR attempts to parse it strictly at first and if that fails falls back to the "quirks mode" parser, similar to the original.
Fixes #241.
This also uses delete_prefix! to avoid another string allocation when converting flag strings into symbols.
Gmail allows (or allowed) users to create flags containing some invalid
atom-specials
chars, such as"]"
orSP
. Ultimately, this isn't unambiguously parsable. But we can workaround it.Prior to #212, the ResponseParser simply grabbed everything inside the parentheses and then scanned through with a very liberal "flag" regexp. This PR attempts to parse it strictly at first and if that fails falls back to the "quirks mode" parser, similar to the original.
Fixes #241.
This also uses
delete_prefix!
to avoid another string allocation when converting flag strings into symbols.Benchmark results: