We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 12aab48 commit a1bbee5Copy full SHA for a1bbee5
2 files changed
src/Foreign/Lua/Module/DocLayout.hs
@@ -237,6 +237,7 @@ docTypeName = "HsLua DocLayout.Doc"
237
peekDoc :: StackIndex -> Lua (Doc Text)
238
peekDoc idx = Lua.ltype idx >>= \case
239
Lua.TypeString -> Doc.literal <$> Lua.peek idx
240
+ Lua.TypeNumber -> Doc.literal <$> Lua.peek idx
241
_ -> Lua.reportValueOnFailure docTypeName
242
(`Lua.toAnyWithName` docTypeName)
243
idx
test/test-doclayout.lua
@@ -38,6 +38,10 @@ return {
38
assert.are_equal(doclayout.render('hello world'), 'hello world')
39
end),
40
41
+ test('numbers can be used as Doc values', function ()
42
+ assert.are_equal(doclayout.render(42), '42')
43
+ end),
44
+
45
test('equality', function ()
46
assert.is_truthy(doclayout.literal "true", doclayout.literal "true")
47
0 commit comments