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 @@ -1096,6 +1096,33 @@ def __init__(
1096
1096
if with_hash :
1097
1097
self .dict ["hash" ] = token .hash
1098
1098
1099
+ @property
1100
+ def token (self ):
1101
+ return self .dict ["token" ]
1102
+
1103
+ @property
1104
+ def start_offset (self ):
1105
+ return self .dict ["start_offset" ]
1106
+
1107
+ @property
1108
+ def end_offset (self ):
1109
+ return self .dict ["end_offset" ]
1110
+
1111
+ @property
1112
+ def position (self ):
1113
+ return self .dict ["position" ]
1114
+
1115
+ @property
1116
+ def position_length (self ):
1117
+ return self .dict ["position_length" ]
1118
+
1119
+ @property
1120
+ def hash (self ):
1121
+ return self .dict ["hash" ]
1122
+
1123
+ def __getitem__ (self , key : str ):
1124
+ return self .dict [key ]
1125
+
1099
1126
def __str__ (self ):
1100
1127
return str (self .dict )
1101
1128
@@ -1109,9 +1136,7 @@ def __init__(
1109
1136
if not with_detail and not with_hash :
1110
1137
self .tokens = [token .token for token in info .tokens ]
1111
1138
else :
1112
- self .tokens = [
1113
- AnalyzeToken (token , with_hash , with_detail ).dict for token in info .tokens
1114
- ]
1139
+ self .tokens = [AnalyzeToken (token , with_hash , with_detail ) for token in info .tokens ]
1115
1140
1116
1141
def __str__ (self ) -> str :
1117
1142
return str (self .tokens )
You can’t perform that action at this time.
0 commit comments