remember to pop
Getty Ritter
1 year, 11 months ago
233 | 233 | |
234 | 234 | handleTag :: TeLML.Tag -> LuaM Text.Text |
235 | 235 | handleTag (TeLML.Tag n ps) = do |
236 | -- evaluate the "arguments" first | |
236 | 237 | ps' <- mapM handleDoc ps |
237 | 238 | Lua.pushstring (Text.encodeUtf8 n) |
238 | 239 | typ <- Lua.gettable 1 |
247 | 248 | actualtyp <- Lua.ltype 2 |
248 | 249 | throw (NotAString n actualtyp) |
249 | 250 | Just r -> do |
251 | Lua.pop 1 | |
250 | 252 | return (Text.decodeUtf8 r) |
251 | 253 | _ -> throw (NotAFunction n typ) |