@@ -57,24 +57,17 @@ attrToMap (id',classes,keyvals) = M.fromList
57 : ("class", unwords classes)
57 : ("class", unwords classes)
60−getList :: StackValue a => LuaState -> Int -> IO [a]
62− continue <- Lua.next lua i'
65− next <- Lua.peek lua (-1)
67− x <- maybe (fail "peek returned Nothing") return next
68− rest <- getList lua i'
72#if MIN_VERSION_hslua(0,4,0)
60#if MIN_VERSION_hslua(0,4,0)
61+#if MIN_VERSION_base(4,8,0)
73instance {-# OVERLAPS #-} StackValue [Char] where
62instance {-# OVERLAPS #-} StackValue [Char] where
64+instance StackValue [Char] where
74 push lua cs = Lua.push lua (UTF8.fromString cs)
66 push lua cs = Lua.push lua (UTF8.fromString cs)
75 peek lua i = do
67 peek lua i = do
76 res <- Lua.peek lua i
68 res <- Lua.peek lua i
77 return $ UTF8.toString `fmap` res
69 return $ UTF8.toString `fmap` res
70+ valuetype _ = Lua.TSTRING
79#if MIN_VERSION_base(4,8,0)
72#if MIN_VERSION_base(4,8,0)
80instance {-# OVERLAPS #-} StackValue a => StackValue [a] where
73instance {-# OVERLAPS #-} StackValue a => StackValue [a] where
@@ -93,6 +86,18 @@ instance StackValue a => StackValue [a] where
93 Lua.pop lua 1
86 Lua.pop lua 1
94 return (Just lst)
87 return (Just lst)
95 valuetype _ = Lua.TTABLE
88 valuetype _ = Lua.TTABLE
90+getList :: StackValue a => LuaState -> Int -> IO [a]
92+ continue <- Lua.next lua i'
95+ next <- Lua.peek lua (-1)
97+ x <- maybe (fail "peek returned Nothing") return next
98+ rest <- getList lua i'
98instance StackValue Format where
103instance StackValue Format where