Skip to main content

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    GlobalStat,
31    UnknownStat,
32
33    // expressions
34    ParenExpr,
35    LiteralExpr,
36    ClosureExpr,
37    UnaryExpr,
38    BinaryExpr,
39    TableArrayExpr,       // { a, b, c}
40    TableObjectExpr,      // { a = 1, b = 2, c = 3}
41    TableEmptyExpr,       // {}
42    CallExpr,             // a()
43    RequireCallExpr,      // require('a')
44    ErrorCallExpr,        // error('a')
45    AssertCallExpr,       // assert(a)
46    TypeCallExpr,         // type(a)
47    SetmetatableCallExpr, // setmetatable(a, b)
48    IndexExpr,
49    NameExpr,
50
51    // other
52    LocalName,
53    ParamName,
54    ParamList,
55    CallArgList,
56    TableFieldAssign,
57    TableFieldValue,
58    Attribute,
59
60    // comment
61    Comment,
62
63    // doc tag
64    DocTagClass,
65    DocTagEnum,
66    DocTagInterface,
67    DocTagAlias,
68    DocTagField,
69    DocTagType,
70    DocTagParam,
71    DocTagReturn,
72    DocTagReturnOverload,
73    DocTagGeneric,
74    DocTagSee,
75    DocTagDeprecated,
76    DocTagCast,
77    DocTagOverload,
78    DocTagAsync,
79    DocTagVisibility,
80    DocTagMeta,
81    DocTagOther,
82    DocTagDiagnostic,
83    DocTagVersion,
84    DocTagAs,
85    DocTagNodiscard,
86    DocTagOperator,
87    DocTagModule,
88    DocTagMapping,
89    DocTagNamespace,
90    DocTagUsing,
91    DocTagSource,
92    DocTagReadonly,
93    DocTagReturnCast,
94    DocTagExport,
95    DocTagLanguage,
96    DocTagAttribute,
97    DocTagAttributeUse, // '@['
98    DocTagCallGeneric,
99    DocTagSchema,
100
101    // doc Type
102    TypeArray,          // baseType []
103    TypeUnary,          // keyof type
104    TypeBinary,         // aType | bType, aType & bType, aType extends bType, aType in bType
105    TypeConditional,    // <conditionType> and <trueType> or <falseType>
106    TypeFun,            // fun(<paramList>): returnType
107    TypeGeneric,        // name<typeList>
108    TypeTuple,          // [typeList]
109    TypeObject, // { a: aType, b: bType } or { [1]: aType, [2]: bType } or { a: aType, b: bType, [number]: string }
110    TypeLiteral, // "string" or <integer> or true or false
111    TypeName,   // name
112    TypeInfer,  // infer T
113    TypeVariadic, // type...
114    TypeNullable, // <Type>?
115    TypeStringTemplate, // prefixName.`T`
116    TypeMultiLineUnion, // | simple type # description
117    TypeAttribute, // declare. attribute<(paramList)>
118
119    // follow donot support now
120    TypeMatch,
121    TypeIndexAccess, // type[keyType]
122    TypeMapped,      // { [p in KeyType]+? : ValueType }
123
124    // doc other
125    DocObjectField,
126    DocContinueOrField,
127    // doc parameter
128    DocTypedParameter,
129    DocNamedReturnType,
130    DocGenericParameter,
131    DocGenericDeclareList,
132    DocDiagnosticNameList,
133    DocTypeList,
134    DocTypeFlag,             // (partial, global, local, ...)
135    DocAttributeUse,         // use. attribute in @[attribute1, attribute2, ...]
136    DocAttributeCallArgList, // use. argument list in @[attribute_name(arg1, arg2, ...)]
137    DocOpType,               // +<type>, -<type>, +?
138    DocEnumFieldList,        // ---| <EnumField>
139    DocMappedKey,            // <+/-readonly> [Property in <keyof> KeyType]<+/-?>
140    DocEnumField, // <string> # description or <integer> # description or <name> # description
141    DocOneLineField, // <type> # description
142    DocDiagnosticCodeList, // unused-local, undefined-global ...
143    // start with '#' or '@'
144    DocDescription,
145
146    // [<|>] [<framework>] <version>, <version> can be '5.1', '5.2', '5.3', '5.4', 'JIT', <framework> can be 'openresty'
147    DocVersion,
148}