File: prism-lolcode.html

package info (click to toggle)
node-prismjs 1.30.0%2Bdfsg%2B~1.26.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,220 kB
  • sloc: javascript: 27,628; makefile: 9; sh: 7; awk: 4
file content (62 lines) | stat: -rw-r--r-- 1,656 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<h2>Comments</h2>
<pre><code>BTW Single line comment
OBTW Multi-line
comment TLDR</code></pre>

<h2>Strings and special characters</h2>
<pre><code>"foo :"bar:" baz"
"foo:)bar:>baz"
"Interpolation :{works} too!"</code></pre>

<h2>Numbers</h2>
<pre><code>42
-42
123.456</code></pre>

<h2>Variable declaration</h2>
<pre><code>I HAS A var
var R "THREE"
var R 3</code></pre>

<h2>Types</h2>
<pre><code>MAEK some_expr A YARN
some_var IS NOW A NUMBR</code></pre>

<h2>Full example</h2>
<pre><code>OBTW Convert a number to hexadecimal. This
     is returned as a string.
TLDR
HOW IZ I decimal_to_hex YR num
    I HAS A i ITZ 0
    I HAS A rem
    I HAS A hex_num ITZ A BUKKIT
    I HAS A decimal_num ITZ num
    IM IN YR num_loop
        rem R MOD OF decimal_num AN 16
        I HAS A hex_digit
        rem, WTF?
            OMG 10, hex_digit R "A", GTFO
            OMG 11, hex_digit R "B", GTFO
            OMG 12, hex_digit R "C", GTFO
            OMG 13, hex_digit R "D", GTFO
            OMG 14, hex_digit R "E", GTFO
            OMG 15, hex_digit R "F", GTFO
            OMGWTF, hex_digit R rem
        OIC
        hex_num HAS A SRS i ITZ hex_digit
        decimal_num R QUOSHUNT OF decimal_num AN 16
        BOTH SAEM decimal_num AN 0, O RLY?
            YA RLY, GTFO
            NO WAI, i R SUM OF i AN 1
        OIC
    IM OUTTA YR num_loop
    I HAS A hex_string ITZ A YARN
    IM IN YR string_reverse
        DIFFRINT i AN BIGGR OF i AN 0, O RLY?
            YA RLY, GTFO
        OIC
        hex_string R SMOOSH hex_string AN hex_num'Z SRS i MKAY
        i R DIFF OF i AN 1
    IM OUTTA YR string_reverse
    FOUND YR hex_string
IF U SAY SO</code></pre>