@@ -21,8 +21,6 @@ public class Token {
21
21
public let text : String ?
22
22
public let classification : String
23
23
public let isKeyword : Bool
24
- public let requiresLeadingSpace : Bool
25
- public let requiresTrailingSpace : Bool
26
24
27
25
public var swiftKind : String {
28
26
let name = self . name
@@ -34,7 +32,7 @@ public class Token {
34
32
}
35
33
}
36
34
37
- public init ( name: String , kind: String , serializationCode: Int , unprefixedKind: String ? = nil , text: String ? = nil , classification: String = " None " , isKeyword: Bool = false , requiresLeadingSpace : Bool = false , requiresTrailingSpace : Bool = false ) {
35
+ public init ( name: String , kind: String , serializationCode: Int , unprefixedKind: String ? = nil , text: String ? = nil , classification: String = " None " , isKeyword: Bool = false ) {
38
36
self . name = name
39
37
self . kind = kind
40
38
self . serializationCode = serializationCode
@@ -46,15 +44,13 @@ public class Token {
46
44
self . text = text
47
45
self . classification = classification
48
46
self . isKeyword = isKeyword
49
- self . requiresLeadingSpace = requiresLeadingSpace
50
- self . requiresTrailingSpace = requiresTrailingSpace
51
47
}
52
48
}
53
49
54
50
/// Represents a keyword token.
55
51
public class Keyword : Token {
56
52
public init ( name: String , serializationCode: Int , text: String , classification: String = " Keyword " ) {
57
- super. init ( name: name, kind: " kw_ \( text) " , serializationCode: serializationCode, unprefixedKind: text, text: text, classification: classification, isKeyword: true , requiresTrailingSpace : true )
53
+ super. init ( name: name, kind: " kw_ \( text) " , serializationCode: serializationCode, unprefixedKind: text, text: text, classification: classification, isKeyword: true )
58
54
}
59
55
}
60
56
@@ -72,7 +68,7 @@ public class SilKeyword: Keyword { }
72
68
73
69
public class PoundKeyword : Token {
74
70
public init ( name: String , kind: String , serializationCode: Int , text: String , classification: String = " Keyword " ) {
75
- super. init ( name: name, kind: " pound_ \( kind) " , serializationCode: serializationCode, unprefixedKind: kind, text: text, classification: classification, isKeyword: true , requiresTrailingSpace : true )
71
+ super. init ( name: name, kind: " pound_ \( kind) " , serializationCode: serializationCode, unprefixedKind: kind, text: text, classification: classification, isKeyword: true )
76
72
}
77
73
}
78
74
@@ -173,19 +169,19 @@ let SYNTAX_TOKENS: [Token] = [
173
169
Punctuator ( name: " RightBrace " , kind: " r_brace " , serializationCode: 91 , text: " } " ) ,
174
170
Punctuator ( name: " LeftSquareBracket " , kind: " l_square " , serializationCode: 92 , text: " [ " ) ,
175
171
Punctuator ( name: " RightSquareBracket " , kind: " r_square " , serializationCode: 93 , text: " ] " ) ,
176
- Punctuator ( name: " LeftAngle " , kind: " l_angle " , serializationCode: 94 , text: " < " , requiresLeadingSpace : true , requiresTrailingSpace : true ) ,
177
- Punctuator ( name: " RightAngle " , kind: " r_angle " , serializationCode: 95 , text: " > " , requiresLeadingSpace : true , requiresTrailingSpace : true ) ,
172
+ Punctuator ( name: " LeftAngle " , kind: " l_angle " , serializationCode: 94 , text: " < " ) ,
173
+ Punctuator ( name: " RightAngle " , kind: " r_angle " , serializationCode: 95 , text: " > " ) ,
178
174
Punctuator ( name: " Period " , kind: " period " , serializationCode: 85 , text: " . " ) ,
179
175
Punctuator ( name: " PrefixPeriod " , kind: " period_prefix " , serializationCode: 87 , text: " . " ) ,
180
- Punctuator ( name: " Comma " , kind: " comma " , serializationCode: 84 , text: " , " , requiresTrailingSpace : true ) ,
176
+ Punctuator ( name: " Comma " , kind: " comma " , serializationCode: 84 , text: " , " ) ,
181
177
Punctuator ( name: " Ellipsis " , kind: " ellipsis " , serializationCode: 118 , text: " ... " ) ,
182
- Punctuator ( name: " Colon " , kind: " colon " , serializationCode: 82 , text: " : " , requiresTrailingSpace : true ) ,
178
+ Punctuator ( name: " Colon " , kind: " colon " , serializationCode: 82 , text: " : " ) ,
183
179
Punctuator ( name: " Semicolon " , kind: " semi " , serializationCode: 83 , text: " ; " ) ,
184
- Punctuator ( name: " Equal " , kind: " equal " , serializationCode: 86 , text: " = " , requiresLeadingSpace : true , requiresTrailingSpace : true ) ,
180
+ Punctuator ( name: " Equal " , kind: " equal " , serializationCode: 86 , text: " = " ) ,
185
181
Punctuator ( name: " AtSign " , kind: " at_sign " , serializationCode: 80 , text: " @ " ) ,
186
182
Punctuator ( name: " Pound " , kind: " pound " , serializationCode: 81 , text: " # " ) ,
187
- Punctuator ( name: " PrefixAmpersand " , kind: " amp_prefix " , serializationCode: 96 , text: " & " , requiresLeadingSpace : true , requiresTrailingSpace : true ) ,
188
- Punctuator ( name: " Arrow " , kind: " arrow " , serializationCode: 78 , text: " -> " , requiresTrailingSpace : true ) ,
183
+ Punctuator ( name: " PrefixAmpersand " , kind: " amp_prefix " , serializationCode: 96 , text: " & " ) ,
184
+ Punctuator ( name: " Arrow " , kind: " arrow " , serializationCode: 78 , text: " -> " ) ,
189
185
Punctuator ( name: " Backtick " , kind: " backtick " , serializationCode: 79 , text: " ` " ) ,
190
186
Punctuator ( name: " Backslash " , kind: " backslash " , serializationCode: 100 , text: " \\ " ) ,
191
187
Punctuator ( name: " ExclamationMark " , kind: " exclaim_postfix " , serializationCode: 99 , text: " ! " ) ,
@@ -223,7 +219,7 @@ let SYNTAX_TOKENS: [Token] = [
223
219
Misc ( name: " Unknown " , kind: " unknown " , serializationCode: 115 ) ,
224
220
Misc ( name: " Identifier " , kind: " identifier " , serializationCode: 105 ) ,
225
221
Misc ( name: " UnspacedBinaryOperator " , kind: " oper_binary_unspaced " , serializationCode: 107 ) ,
226
- Misc ( name: " SpacedBinaryOperator " , kind: " oper_binary_spaced " , serializationCode: 108 , requiresLeadingSpace : true , requiresTrailingSpace : true ) ,
222
+ Misc ( name: " SpacedBinaryOperator " , kind: " oper_binary_spaced " , serializationCode: 108 ) ,
227
223
Misc ( name: " PostfixOperator " , kind: " oper_postfix " , serializationCode: 110 ) ,
228
224
Misc ( name: " PrefixOperator " , kind: " oper_prefix " , serializationCode: 109 ) ,
229
225
Misc ( name: " DollarIdentifier " , kind: " dollarident " , serializationCode: 106 ) ,
0 commit comments