summaryrefslogtreecommitdiff
path: root/src/tests/eolian/data/docs.eo
blob: 1f48af5a886f2c45163a6c79af586886fe9f3c10 (plain)
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
struct Foo {
    [[This is struct Foo.
      It does stuff.

      Note: This is a note.

      This is a longer description for struct Foo.

      Warning: This is a warning. You can only use Warning: and
      Note: at the beginning of a paragraph.

      This is another paragraph.

      @since 1.66
    ]]
    field1: int; [[Field documentation.]]
    field2: float;
    field3: short; [[Another field documentation.]]
}

enum Bar {
    [[Docs for enum Bar.]]
    blah = 0,
    foo = 1, [[Docs for foo.]]
    bar = 2 [[Docs for bar.]]
}

type Alias: Bar; [[Docs for typedef.

                   More docs for typedef.
                   See @Bar. @since 2.0
                 ]]

var pants: int = 150; [[Docs for var.]]

struct Opaque; [[Opaque struct docs. See @Foo for another struct.]]

class Docs {
    [[Docs for class.

      More docs for class. Testing references now.
      @Foo
      @Bar
      @Alias
      @pants
      @.meth
      @.prop
      @.prop.get
      @.prop.set
      @Foo.field1
      @Bar.foo
      @Docs

      @since 1.18
    ]]
    legacy_prefix: docs;
    methods {
        meth {
            [[Method documentation.]]
            params {
                @in a: int; [[Param documentation.]]
                @out b: float;
                @out c: long; [[Another param documentation.]]
            }
            return: int; [[Return documentation.]]
        }
        @property prop {
            [[Property common documentation.

              @since 1.18
            ]]
            get {
                [[Get documentation.]]
            }
            set {
                [[Set documentation.]]
            }
            values {
                val: int; [[Value documentation.]]
            }
        }
    }
    events {
        clicked; [[Event docs.]]
    }
}