@@ -31,7 +31,8 @@ instance SExpable Bool where
31 toSExp False = BoolAtom False
31 toSExp False = BoolAtom False
33instance SExpable String where
33instance SExpable String where
34+ toSExp (':' : xs) = SymbolAtom xs
34− toSExp s = StringAtom s
35+ toSExp s = StringAtom s
36instance SExpable Integer where
37instance SExpable Integer where
37 toSExp n = IntegerAtom n
38 toSExp n = IntegerAtom n
@@ -79,12 +80,14 @@ parseSExp input = parse pSExp "(unknown)" input
80data IdeSlaveCommand = REPLCompletions String
81data IdeSlaveCommand = REPLCompletions String
81 | Interpret String
82 | Interpret String
82 deriving Show
84 deriving Show
84sexpToCommand :: SExp -> Maybe IdeSlaveCommand
86sexpToCommand :: SExp -> Maybe IdeSlaveCommand
85sexpToCommand (List (x:[])) = sexpToCommand x
87sexpToCommand (List (x:[])) = sexpToCommand x
86sexpToCommand (List [SymbolAtom "interpret", StringAtom cmd]) = Just (Interpret cmd)
88sexpToCommand (List [SymbolAtom "interpret", StringAtom cmd]) = Just (Interpret cmd)
87sexpToCommand (List [SymbolAtom "repl-completions", StringAtom prefix]) = Just (REPLCompletions prefix)
89sexpToCommand (List [SymbolAtom "repl-completions", StringAtom prefix]) = Just (REPLCompletions prefix)
90+sexpToCommand (List [SymbolAtom "load-file", StringAtom filename]) = Just (LoadFile filename)
88sexpToCommand _ = Nothing
91sexpToCommand _ = Nothing
90receiveMessage :: IO (SExp)
93receiveMessage :: IO (SExp)