You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is that pQuotedString uses reads, which tries to interpret a quoted string as a Haskell style string literal, instead of using a Parsec parser.
One solution might be to forgo any unescaping and just return the raw string. Another solution might be to make the parsing and printing understand NeXTStep style escaping.
I’ve come up with a very hacky workaround just to unblock myself to see if I can use this library on that file that I’m interested in. A proper solution would probably use a parser, perhaps similar to https://stackoverflow.com/q/24106314/1988505.
The issue is that
pQuotedString
usesreads
, which tries to interpret a quoted string as a Haskell style string literal, instead of using aParsec
parser.nextstep-plist/Text/NSPlist/Parsec.hs
Lines 70 to 75 in 48ec35d
For example, trying to parse a backslash in a quoted string:
fails:
This is because it’s trying to interpret Haskell specific escape codes, escape characters, and numeric escapes:
See §2.6 for more info. https://www.haskell.org/onlinereport/lexemes.html
One solution might be to forgo any unescaping and just return the raw string. Another solution might be to make the parsing and printing understand NeXTStep style escaping.
Background
I‘m looking into building a tool (gnarf/osx-compose-key#17) that parses
DefaultKeyBinding.dict
files, which uses backslashes/escaping heavily, as a learning exercise.The text was updated successfully, but these errors were encountered: