File tree Expand file tree Collapse file tree 1 file changed +28
-3
lines changed Expand file tree Collapse file tree 1 file changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -1115,6 +1115,33 @@ def __init__(
1115
1115
if with_hash :
1116
1116
self .dict ["hash" ] = token .hash
1117
1117
1118
+ @property
1119
+ def token (self ):
1120
+ return self .dict ["token" ]
1121
+
1122
+ @property
1123
+ def start_offset (self ):
1124
+ return self .dict ["start_offset" ]
1125
+
1126
+ @property
1127
+ def end_offset (self ):
1128
+ return self .dict ["end_offset" ]
1129
+
1130
+ @property
1131
+ def position (self ):
1132
+ return self .dict ["position" ]
1133
+
1134
+ @property
1135
+ def position_length (self ):
1136
+ return self .dict ["position_length" ]
1137
+
1138
+ @property
1139
+ def hash (self ):
1140
+ return self .dict ["hash" ]
1141
+
1142
+ def __getitem__ (self , key : str ):
1143
+ return self .dict [key ]
1144
+
1118
1145
def __str__ (self ):
1119
1146
return str (self .dict )
1120
1147
@@ -1128,9 +1155,7 @@ def __init__(
1128
1155
if not with_detail and not with_hash :
1129
1156
self .tokens = [token .token for token in info .tokens ]
1130
1157
else :
1131
- self .tokens = [
1132
- AnalyzeToken (token , with_hash , with_detail ).dict for token in info .tokens
1133
- ]
1158
+ self .tokens = [AnalyzeToken (token , with_hash , with_detail ) for token in info .tokens ]
1134
1159
1135
1160
def __str__ (self ) -> str :
1136
1161
return str (self .tokens )
You can’t perform that action at this time.
0 commit comments