forked from scala-js/scala-js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tags.scala
147 lines (123 loc) · 5.65 KB
/
Tags.scala
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
139
140
141
142
143
144
145
146
147
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js IR **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2014, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ http://scala-js.org/ **
** /____/\___/_/ |_/____/_/ | |__/ /____/ **
** |/____/ **
\* */
package org.scalajs.core.ir
/** Serialization and hashing tags for trees and types */
private[ir] object Tags {
// Tags for Trees
/** Use to denote optional trees. */
final val TagEmptyTree = 1
final val TagVarDef = TagEmptyTree + 1
final val TagSkip = TagVarDef + 1
final val TagBlock = TagSkip + 1
final val TagLabeled = TagBlock + 1
final val TagAssign = TagLabeled + 1
final val TagReturn = TagAssign + 1
final val TagIf = TagReturn + 1
final val TagWhile = TagIf + 1
final val TagDoWhile = TagWhile + 1
final val TagTryCatch = TagDoWhile + 1
final val TagTryFinally = TagTryCatch + 1
final val TagThrow = TagTryFinally + 1
final val TagContinue = TagThrow + 1
final val TagMatch = TagContinue + 1
final val TagDebugger = TagMatch + 1
final val TagNew = TagDebugger + 1
final val TagLoadModule = TagNew + 1
final val TagStoreModule = TagLoadModule + 1
final val TagSelect = TagStoreModule + 1
final val TagSelectStatic = TagSelect + 1
final val TagApply = TagSelectStatic + 1
final val TagApplyStatically = TagApply + 1
final val TagApplyStatic = TagApplyStatically + 1
final val TagUnaryOp = TagApplyStatic + 1
final val TagBinaryOp = TagUnaryOp + 1
final val TagNewArray = TagBinaryOp + 1
final val TagArrayValue = TagNewArray + 1
final val TagArrayLength = TagArrayValue + 1
final val TagArraySelect = TagArrayLength + 1
final val TagRecordValue = TagArraySelect + 1
final val TagIsInstanceOf = TagRecordValue + 1
final val TagAsInstanceOf = TagIsInstanceOf + 1
final val TagUnbox = TagAsInstanceOf + 1
final val TagGetClass = TagUnbox + 1
final val TagCallHelper = TagGetClass + 1
final val TagJSNew = TagCallHelper + 1
final val TagJSDotSelect = TagJSNew + 1
final val TagJSBracketSelect = TagJSDotSelect + 1
final val TagJSFunctionApply = TagJSBracketSelect + 1
final val TagJSDotMethodApply = TagJSFunctionApply + 1
final val TagJSBracketMethodApply = TagJSDotMethodApply + 1
final val TagJSSuperBracketSelect = TagJSBracketMethodApply + 1
final val TagJSSuperBracketCall = TagJSSuperBracketSelect + 1
final val TagJSSuperConstructorCall = TagJSSuperBracketCall + 1
final val TagLoadJSConstructor = TagJSSuperConstructorCall + 1
final val TagLoadJSModule = TagLoadJSConstructor + 1
final val TagJSSpread = TagLoadJSModule + 1
final val TagJSDelete = TagJSSpread + 1
final val TagJSUnaryOp = TagJSDelete + 1
final val TagJSBinaryOp = TagJSUnaryOp + 1
final val TagJSArrayConstr = TagJSBinaryOp + 1
final val TagJSObjectConstr = TagJSArrayConstr + 1
final val TagJSGlobalRef = TagJSObjectConstr + 1
final val TagJSLinkingInfo = TagJSGlobalRef + 1
final val TagUndefined = TagJSLinkingInfo + 1
final val TagNull = TagUndefined + 1
final val TagBooleanLiteral = TagNull + 1
final val TagCharLiteral = TagBooleanLiteral + 1
final val TagByteLiteral = TagCharLiteral + 1
final val TagShortLiteral = TagByteLiteral + 1
final val TagIntLiteral = TagShortLiteral + 1
final val TagLongLiteral = TagIntLiteral + 1
final val TagFloatLiteral = TagLongLiteral + 1
final val TagDoubleLiteral = TagFloatLiteral + 1
final val TagStringLiteral = TagDoubleLiteral + 1
final val TagClassOf = TagStringLiteral + 1
final val TagVarRef = TagClassOf + 1
final val TagThis = TagVarRef + 1
final val TagClosure = TagThis + 1
// Tags for member defs
final val TagFieldDef = 1
final val TagMethodDef = TagFieldDef + 1
final val TagPropertyDef = TagMethodDef + 1
// Tags for top-level export defs
final val TagTopLevelConstructorExportDef = 1
final val TagTopLevelJSClassExportDef = TagTopLevelConstructorExportDef + 1
final val TagTopLevelModuleExportDef = TagTopLevelJSClassExportDef + 1
final val TagTopLevelMethodExportDef = TagTopLevelModuleExportDef + 1
final val TagTopLevelFieldExportDef = TagTopLevelMethodExportDef + 1
// Tags for Types
final val TagAnyType = 1
final val TagNothingType = TagAnyType + 1
final val TagUndefType = TagNothingType + 1
final val TagBooleanType = TagUndefType + 1
final val TagCharType = TagBooleanType + 1
final val TagByteType = TagCharType + 1
final val TagShortType = TagByteType + 1
final val TagIntType = TagShortType + 1
final val TagLongType = TagIntType + 1
final val TagFloatType = TagLongType + 1
final val TagDoubleType = TagFloatType + 1
final val TagStringType = TagDoubleType + 1
final val TagNullType = TagStringType + 1
final val TagClassType = TagNullType + 1
final val TagArrayType = TagClassType + 1
final val TagRecordType = TagArrayType + 1
final val TagNoType = TagRecordType + 1
// Tags for TypeRefs
final val TagClassRef = 1
final val TagArrayTypeRef = TagClassRef + 1
// Tags for PropertyNames
final val TagPropertyNameIdent = 1
final val TagPropertyNameStringLiteral = TagPropertyNameIdent + 1
final val TagPropertyNameComputedName = TagPropertyNameStringLiteral + 1
// Tags for JS native loading specs
final val TagJSNativeLoadSpecNone = 0
final val TagJSNativeLoadSpecGlobal = TagJSNativeLoadSpecNone + 1
final val TagJSNativeLoadSpecImport = TagJSNativeLoadSpecGlobal + 1
final val TagJSNativeLoadSpecImportWithGlobalFallback = TagJSNativeLoadSpecImport + 1
}