From a575c678252b8e6107b73cd53ed941797454de63 Mon Sep 17 00:00:00 2001 From: Nathanne Isip Date: Sun, 30 Jun 2024 20:38:08 +0800 Subject: [PATCH] Added code coloring on Language Constructs page. --- site/constructs.pug | 54 ++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/site/constructs.pug b/site/constructs.pug index 326e6de..f3f3be3 100644 --- a/site/constructs.pug +++ b/site/constructs.pug @@ -91,13 +91,13 @@ html(lang="en") p(class="text-white m-0 ms-2") example_01.utx code(class="text-dark") pre(class="border border-primary p-2") - | # Get the type of variable x. + | # Get the type of variable x. | - | x = type "Hello!"; - | render x + "\r\n"; + | x = type "Hello!"; + | render x + "\r\n"; | - | y = type 3.14; - | render y + "\r\n"; + | y = type 3.14; + | render y + "\r\n"; br b(class="pb-2") Block Expressions @@ -107,26 +107,26 @@ html(lang="en") p(class="text-white m-0 ms-2") example_02.utx code(class="text-dark") pre(class="border border-primary p-2") - | # Block example as function body. + | # Block example as function body. | - | add = func(x, y) { - | ret x + y; + | add = func(x, y) { + | ret x + y; | }; | - | render add(5, 10); + | render add(5, 10); div(class="bg-primary w-100 mt-2") p(class="text-white m-0 ms-2") example_03.utx code(class="text-dark") pre(class="border border-primary p-2") - | # Block example as variable value. + | # Block example as variable value. | | message = { - | hello = "Hello"; - | hello + ", world!"; + | hello = "Hello"; + | hello + ", world!"; | }; | - | render message + "\r\n"; + | render message + "\r\n"; br b(class="pb-2") Render Expression @@ -136,10 +136,10 @@ html(lang="en") p(class="text-white m-0 ms-2") example_04.utx code(class="text-dark") pre(class="border border-primary p-2") - | # Render expression examples. + | # Render expression examples. | - | render "Hello, world!\r\n"; - | render 3.14; + | render "Hello, world!\r\n"; + | render 3.14; br b(class="pb-2") Catch Expression @@ -149,16 +149,16 @@ html(lang="en") p(class="text-white m-0 ms-2") example_05.utx code(class="text-dark") pre(class="border border-primary p-2") - | # Throw and catch example + | # Throw and catch example | - | catch { - | throw "This is an error."; + | catch { + | throw "This is an error."; | } - | handle e { - | render "Error: " + e + "\r\n"; + | handle e { + | render "Error: " + e + "\r\n"; | } - | then { - | render "Error was caught.\r\n"; + | then { + | render "Error was caught.\r\n"; | }; br @@ -169,13 +169,13 @@ html(lang="en") p(class="text-white m-0 ms-2") example_06.utx code(class="text-dark") pre(class="border border-primary p-2") - | # Increment count variable using do + | # Increment count variable using do | | count = 0; - | do { - | render count + "\r\n"; + | do { + | render count + "\r\n"; | count = count + 1; - | } while(count < 5); + | } while(count < 5); div(class="col-lg-2")