finish mapDecl parser

This commit is contained in:
Corey O'Connor 2014-06-03 23:14:37 -07:00
parent 46e93af4fe
commit cf3d3c4b3a

View File

@ -168,11 +168,11 @@ configLexer = P.makeTokenParser configLanguage
mapDecl = do
void $ string "map"
P.whiteSpace configLexer
termIdent <- (char "_" >> return Nothing) <|>
termIdent <- (char "_" >> return Nothing) <|> (Just <$> P.stringLiteral configLexer)
bytes <- P.stringLiteral configLexer
key <- parseKey
modifiers <- parseModifiers
lift $ tell $ def { inputOverrides = [(bytes, EvKey key modifiers)] }
lift $ tell $ def { inputOverrides = [(termIdent, bytes, EvKey key modifiers)] }
-- TODO: Generated by a vim macro. There is a better way here. Derive parser? Use Read
-- instance?