emmylua_parser/kind/
lua_syntax_kind.rs

1#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
2#[repr(u16)]
3pub enum LuaSyntaxKind {
4    None,
5    // source
6    Chunk,
7
8    // block
9    Block,
10
11    // statements
12    EmptyStat,
13    LocalStat,
14    LocalFuncStat,
15    IfStat,
16    ElseIfClauseStat,
17    ElseClauseStat,
18    WhileStat,
19    DoStat,
20    ForStat,
21    ForRangeStat,
22    RepeatStat,
23    FuncStat,
24    LabelStat,
25    BreakStat,
26    ReturnStat,
27    GotoStat,
28    CallExprStat,
29    AssignStat,
30    UnknownStat,
31
32    // expressions
33    ParenExpr,
34    LiteralExpr,
35    ClosureExpr,
36    UnaryExpr,
37    BinaryExpr,
38    TableArrayExpr,       // { a, b, c}
39    TableObjectExpr,      // { a = 1, b = 2, c = 3}
40    TableEmptyExpr,       // {}
41    CallExpr,             // a()
42    RequireCallExpr,      // require('a')
43    ErrorCallExpr,        // error('a')
44    AssertCallExpr,       // assert(a)
45    TypeCallExpr,         // type(a)
46    SetmetatableCallExpr, // setmetatable(a, b)
47    IndexExpr,
48    NameExpr,
49
50    // other
51    LocalName,
52    ParamName,
53    ParamList,
54    CallArgList,
55    TableFieldAssign,
56    TableFieldValue,
57    Attribute,
58
59    // comment
60    Comment,
61
62    // doc tag
63    DocTagClass,
64    DocTagEnum,
65    DocTagInterface,
66    DocTagAlias,
67    DocTagField,
68    DocTagType,
69    DocTagParam,
70    DocTagReturn,
71    DocTagGeneric,
72    DocTagSee,
73    DocTagDeprecated,
74    DocTagCast,
75    DocTagOverload,
76    DocTagAsync,
77    DocTagVisibility,
78    DocTagMeta,
79    DocTagOther,
80    DocTagDiagnostic,
81    DocTagVersion,
82    DocTagAs,
83    DocTagNodiscard,
84    DocTagOperator,
85    DocTagModule,
86    DocTagMapping,
87    DocTagNamespace,
88    DocTagUsing,
89    DocTagSource,
90    DocTagReadonly,
91
92    // doc Type
93    TypeArray,          // baseType []
94    TypeUnary,          // keyof type
95    TypeBinary,         // aType | bType, aType & bType, aType extends bType, aType in bType
96    TypeConditional,    // <conditionType> and <trueType> or <falseType>
97    TypeFun,            // fun(<paramList>): returnType
98    TypeGeneric,        // name<typeList>
99    TypeTuple,          // [typeList]
100    TypeObject, // { a: aType, b: bType } or { [1]: aType, [2]: bType } or { a: aType, b: bType, [number]: string }
101    TypeLiteral, // "string" or <integer> or true or false
102    TypeName,   // name
103    TypeVariadic, // type...
104    TypeNullable, // <Type>?
105    TypeStringTemplate, // prefixName.`T`
106    TypeMultiLineUnion, // | simple type # description
107
108    // follow donot support now
109    TypeMatch,
110    TypeIndexAccess, // type[keyType]
111    TypeMapped,      // { [p in KeyType]+? : ValueType }
112
113    // doc other
114    DocObjectField,
115    DocContinueOrField,
116    // doc parameter
117    DocTypedParameter,
118    DocNamedReturnType,
119    DocGenericParameter,
120    DocGenericDeclareList,
121    DocDiagnosticNameList,
122    DocTypeList,
123    DocAttribute,
124    DocOpType,             // +<type>, -<type>, +?
125    DocMappedKeys,         // [p in KeyType]?
126    DocEnumFieldList,      // ---| <EnumField>
127    DocEnumField, // <string> # description or <integer> # description or <name> # description
128    DocOneLineField, // <type> # description
129    DocDiagnosticCodeList, // unused-local, undefined-global ...
130    // start with '#' or '@'
131    DocDescription,
132
133    // [<|>] [<framework>] <version>, <version> can be '5.1', '5.2', '5.3', '5.4', 'JIT', <framework> can be 'openresty'
134    DocVersion,
135}