From 3bfb29ee6d1e4c6163cf1cf68829e927ff27da52 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 2 Sep 2024 10:18:40 -0300 Subject: [PATCH] fixup! add lua code block marks --- docs/pragmas.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/pragmas.md b/docs/pragmas.md index 7fd1a697..b33efb4c 100644 --- a/docs/pragmas.md +++ b/docs/pragmas.md @@ -33,7 +33,7 @@ Teal now features _optional function arguments_. if an argument can be optionally elided, you now can, or rather, have to, annotate it explicitly adding a `?` to its name: -``` +```lua local function greet(greeting: string, name?: string) if name then print(string.format("%s, %s!", greeting, name)) @@ -58,7 +58,7 @@ function arity checks. You can enable or disable arity checks using the `arity` pragma. Let's first assume we have an old library written for older versions of Teal: -``` +```lua -- old_library.tl local record old_library end @@ -79,7 +79,7 @@ Now we want to use this library with the current version of Teal, but we don't want to lose arity checks in our own code. We can temporarily disable arity checks, require the library, then re-enable them: -``` +```lua --#pragma arity off local old_library = require("old_library) --#pragma arity on