File: comments.liq

package info (click to toggle)
liquidsoap 2.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,844 kB
  • sloc: ml: 74,136; javascript: 27,320; ansic: 505; sh: 139; xml: 114; lisp: 96; makefile: 26
file content (86 lines) | stat: -rw-r--r-- 1,150 bytes parent folder | download | duplicates (2)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#<------#
This is
a multiline comment
with > some # of
these characters in it.
#------>#

#<---------------
# Yet another
# form of multiline comment
---------------->#

# A one line comment

#<
can be
followed
by
multiple
lines comment
>#

#<
multiline comment can start and end
in the middle of a line
>#

#<-----#
Anything following them
is executed
#---->#
x = 1

#<-----#y = x + 2.
Anything after the mark
is comment
#---->#

#<---------------
# Nested comments

#<
Are accepted
>#

#---------------->#
s =
  "foo
#<-----
this is a comment inside a string,
it is not a code comment!
#---->
bar
"

ignore(s)
r =
  r/foo
#<-----
this is a comment inside a regexp,
it is not a code comment!
#---->
bar/

ignore(r)

def f() =
  test.equal(x, 1)
  try
    let eval _ = "#<----#
This comment is not terminated"
    test.fail()
  catch _ do
    ()
  end

  let eval _ =
    "# single line comment can be followed by EOF"
  test.equal("a#b", string.base64.decode("YSNi"))
  test.equal(string(r/a#b/), "r/a#b/")
  test.equal("a#<b>#c", string.base64.decode("YSM8Yj4jYw=="))
  test.equal(string(r/a#<b>#c/), "r/a#<b>#c/")
  test.pass()
end

test.check(f)