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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#![doc = include_str!("README.md")]

// SPACES

/// Empty string
pub const EMPTY: &str = "";
/// Single space
pub const SPACE: &str = " ";
/// New line string
pub const NEW_LINE: &str = "\n";
/// New line character
pub const NEW_LINE_CH: char = '\n';
/// Default indentation value
pub const INDENT: &str = "    ";

// SYMBOLS
/// '.' used to separate qualifiers
pub const DOT: &str = ".";
/// '*' symbol used for star projections
pub const STAR: &str = "*";
/// ':' separates parameter / property name and type
pub const COLON: &str = ":";
/// `=` assign operator
pub const ASSIGN: &str = "=";
/// ',' separates list of values
pub const COMMA: &str = ",";
/// ';' denotes statement end
pub const SEMICOLON: &str = ";";
/// '?' denotes nullability
pub const QUESTION_MARK: &str = "?";
/// `@` used as annotation prefix
pub const AT: &str = "@";
/// '`' used to escape non JVM compatible identifiers
pub const TICK: &str = "`";
/// `<` start of generic parameters
pub const ANGLE_BRACKET_LEFT: &str = "<";
/// `>` end of generic parameters
pub const ANGLE_BRACKET_RIGHT: &str = ">";
/// '->' separates lambda arguments from body
pub const ARROW: &str = "->";
/// '{' opens new scopes and lambda body
pub const CURLY_BRACKET_LEFT: &str = "{";
/// '}' closes scopes and lambda body
pub const CURLY_BRACKET_RIGHT: &str = "}";
/// '(' opens parameter / argument lists
pub const ROUND_BRACKET_LEFT: &str = "(";
/// ')' opens parameter / argument lists
pub const ROUND_BRACKET_RIGHT: &str = ")";

// Special variables

/// 'value' special argument inside property's `set(value) {...}` and `get() {...}`
pub const CONV_VAR_VALUE: &str = "value";
/// 'filed' special variable inside property's `set(value) {...}` and `get() {...}`
pub const CONV_VAR_FIELD: &str = "field";


// CATEGORY
pub const NAME_ESCAPED_TOKENS: &str = " -!\"#$%^&()*+,-=?@^_{|}~";
pub const NAME_DISALLOWED_TOKENS: &str = ".:/\\[]<>";

// Comments

/// '//' used to start single line comments
pub const INLINE_COMMENT_START: &str = "//";

/// '/*' used to start block comments
pub const BLOCK_COMMENT_START: &str = "/*";
/// ' *' used in middle of block comments
pub const BLOCK_COMMENT_MIDDLE: &str = " *";
/// ' */' used to e end block comments
pub const BLOCK_COMMENT_END: &str = " */";

/// '/**' used to start kdoc comments
pub const KDOC_COMMENT_START: &str = "/**";
/// ' *' used in middle of kdoc comments
pub const KDOC_COMMENT_MIDDLE: &str = " *";
/// ' */' used to end kdoc comments
pub const KDOC_COMMENT_END: &str = " */";

pub mod keyword {
    pub const CLASS: &str = "class";
    /// 'this' keyword, refers to current context parameter or parent constructor
    pub const THIS: &str = "this";
    pub const AS: &str = "as";
    pub const OPERATOR: &str = "operator";
    pub const INLINE: &str = "inline";
    pub const OVERRIDE: &str = "override";
    pub const SUSPEND: &str = "suspend";
    pub const SET: &str = "set";
    pub const GET: &str = "get";
    pub const PACKAGE: &str = "package";
    pub const TYPEALIAS: &str = "typealias";
    pub const FUN: &str = "fun";
    pub const VAL: &str = "val";
    pub const VAR: &str = "var";
    pub const PUBLIC: &str = "public";
    pub const INTERNAL: &str = "internal";
    pub const PRIVATE: &str = "private";
    pub const PROTECTED: &str = "protected";
    pub const OPEN: &str = "open";
    pub const SEALED: &str = "sealed";
    pub const OBJECT: &str = "object";
    pub const ENUM: &str = "enum";
    /// 'data' class keyword
    pub const DATA: &str = "data";
    pub const INTERFACE: &str = "interface";
    pub const FINAL: &str = "final";
    pub const ABSTRACT: &str = "abstract";
    pub const IMPORT: &str = "import";
    pub const CONST: &str = "const";
    /// 'by' keyword
    pub const BY: &str = "by";
    /// 'constructor' keyword
    pub const CONSTRUCTOR: &str = "constructor";
    /// 'init' keyword, used for initializing class after constructor call
    pub const INIT: &str = "init";
    /// `companion`
    pub const COMPANION: &str = "companion";
    /// `inner`
    pub const INNER: &str = "inner";

    // Generics
    pub const WHERE: &str = "where";
    pub const IN: &str = "in";
    pub const OUT: &str = "out";
    /// `reified`
    pub const REIFIED: &str = "reified";

    // Annotation target
    pub const FILE: &str = "file";
    pub const PROPERTY: &str = "property";
    pub const FIELD: &str = "field";
    pub const RECEIVER: &str = "receiver";
    pub const PARAM: &str = "param";
    pub const SET_PARAM: &str = "setparam";
    pub const DELEGATE: &str = "delegate";
}