File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 2323class _SourceReader ():
2424 # Used to tokenize python source code
2525 def __init__ (self , source ):
26- self .lines = re .findall (r'[^\n]*\n' , source )
26+ self .lines = re .findall (r'[^\n]*\n? ' , source )
2727 # To pop lines later
2828 self .lines .reverse ()
2929
@@ -118,12 +118,12 @@ def _search_symbol(source, symbol):
118118 if source_tokens_str [i :i + symbol_len ] == symbol_tokens_str :
119119 location_range = {
120120 'start' : {
121- 'line' : source_tokens [2 ][0 ] - 1 ,
122- 'character' : source_tokens [2 ][1 ],
121+ 'line' : source_tokens [i ][ 2 ][0 ] - 1 ,
122+ 'character' : source_tokens [i ][ 2 ][1 ],
123123 },
124124 'end' : {
125- 'line' : source_tokens [3 ][0 ] - 1 ,
126- 'character' : source_tokens [3 ][1 ],
125+ 'line' : source_tokens [i + symbol_len - 1 ][ 3 ][0 ] - 1 ,
126+ 'character' : source_tokens [i + symbol_len - 1 ][ 3 ][1 ],
127127 }
128128 }
129129 locations .append (location_range )
You can’t perform that action at this time.
0 commit comments