File: tmultiline_comments.nim

package info (click to toggle)
nim 2.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,911,644 kB
  • sloc: sh: 24,603; ansic: 1,761; python: 1,492; makefile: 1,013; sql: 298; asm: 141; xml: 13
file content (64 lines) | stat: -rw-r--r-- 1,121 bytes parent folder | download | duplicates (6)
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
discard """
  output: '''3'''
"""

proc main* =
  ##[Mutltie akdlsf comment with #[nesting].
  Yay, that is so cool.
  ]##
  echo "foo bar"
  for s in ["one", "two", #["three",]# "four"]:
    echo s

var foo #[ Test the new inline comments ]#: int = 3
##[ A
novel documentation comment
#[Nesting works to some extend]
##[ Nested doc comment! ]##
]#
]##
echo $foo

  #[Comment here.
  Multiple lines
  are not a problem.]#

  #[  #[ Multiline comment in already
     commented out code. ]#
  proc p[T](x: T) = discard
  ]#

proc bar =
  ##[Long documentation comment
  here.
  ]##


proc write(a: auto, x: varargs[string, `$`]) =
  stdout.write ($a)
  for o in x:
    stdout.write(o)

proc writeln(a: auto, x: varargs[string, `$`]) =
  write a, x
  stdout.write "\n"

proc write() = write(stdout)
proc writeln() =
  stdout.write "\n"

#[  #[ Multiline comment in already
   commented out code. ]#
proc p[T](x: T) = discard
]#

var hello = #[(x in bar)^^ "Hello" # greetings
]#"Hello"
proc maino =
  write hello, " Test Me "
  writeln()
  write 3
  block:
    write()
    write " times more"
  #[ test ]#  writeln " Again"