fixed jump to todo bug

This commit is contained in:
Allen Webster 2017-07-17 19:03:38 -04:00
parent a1b0f805d1
commit bd5569a389
2 changed files with 19 additions and 17 deletions

View File

@ -24,46 +24,48 @@ struct Name_Based_Jump_Location{
}; };
static bool32 static bool32
ms_style_verify(String line, int32_t paren_pos){ ms_style_verify(String line, int32_t left_paren_pos, int32_t right_paren_pos){
int32_t result = false; int32_t result = false;
String line_part = substr_tail(line, paren_pos); String line_part = substr_tail(line, right_paren_pos);
if (match_part_sc(line_part, ") : ")){ if (match_part_sc(line_part, ") : ")){
result = true; result = true;
} }
else if (match_part_sc(line_part, "): ")){ else if (match_part_sc(line_part, "): ")){
result = true; result = true;
} }
if (result){
String number = substr(line, left_paren_pos, right_paren_pos - left_paren_pos);
if (!str_is_int_s(number)){
result = false;
}
}
return(result); return(result);
} }
static bool32 static bool32
parse_jump_location(String line, Name_Based_Jump_Location *location, int32_t *colon_char, bool32 *is_sub_error){ parse_jump_location(String line, Name_Based_Jump_Location *location, int32_t *colon_char, bool32 *is_sub_error){
bool32 result = false; bool32 result = false;
*is_sub_error = (line.str[0] == ' ');
int32_t whitespace_length = 0; int32_t whitespace_length = 0;
String original_line = line;
line = skip_chop_whitespace(line, &whitespace_length); line = skip_chop_whitespace(line, &whitespace_length);
int32_t colon_pos = 0; int32_t colon_pos = 0;
bool32 is_ms_style = false; bool32 is_ms_style = false;
*is_sub_error = false; int32_t left_paren_pos = find_s_char(line, 0, '(');
if (original_line.str[0] == ' '){ int32_t right_paren_pos = find_s_char(line, left_paren_pos, ')');
*is_sub_error = true; while (!is_ms_style && right_paren_pos < line.size){
} if (ms_style_verify(line, left_paren_pos, right_paren_pos)){
int32_t paren_pos = find_s_char(line, 0, ')');
while (!is_ms_style && paren_pos < line.size){
if (ms_style_verify(line, paren_pos)){
is_ms_style = true; is_ms_style = true;
colon_pos = find_s_char(line, paren_pos, ':'); colon_pos = find_s_char(line, right_paren_pos, ':');
if (colon_pos < line.size){ if (colon_pos < line.size){
String location_str = substr(line, 0, colon_pos); String location_str = substr(line, 0, colon_pos);
location_str = skip_chop_whitespace(location_str); location_str = skip_chop_whitespace(location_str);
int32_t close_pos = paren_pos; int32_t close_pos = right_paren_pos;
int32_t open_pos = rfind_s_char(location_str, close_pos, '('); int32_t open_pos = left_paren_pos;
if (0 < open_pos && open_pos < location_str.size){ if (0 < open_pos && open_pos < location_str.size){
String file = substr(location_str, 0, open_pos); String file = substr(location_str, 0, open_pos);
@ -100,7 +102,8 @@ parse_jump_location(String line, Name_Based_Jump_Location *location, int32_t *co
} }
} }
else{ else{
paren_pos = find_s_char(line, paren_pos+1, ')'); left_paren_pos = find_s_char(line, left_paren_pos + 1, '(');
right_paren_pos = find_s_char(line, left_paren_pos, ')');
} }
} }

View File

@ -1360,7 +1360,6 @@ App_Step_Sig(app_step){
// NOTE(allen): OS clipboard event handling // NOTE(allen): OS clipboard event handling
String clipboard = input->clipboard; String clipboard = input->clipboard;
if (clipboard.str){ if (clipboard.str){
String *dest =working_set_next_clipboard_string(&models->mem.general, &models->working_set, clipboard.size); String *dest =working_set_next_clipboard_string(&models->mem.general, &models->working_set, clipboard.size);
dest->size = eol_convert_in(dest->str, clipboard.str, clipboard.size); dest->size = eol_convert_in(dest->str, clipboard.str, clipboard.size);
@ -1567,7 +1566,7 @@ App_Step_Sig(app_step){
} }
} }
for (u32 i = 0; i < proc_free_count; ++i){ for (i32 i = proc_free_count - 1; i >= 0; ++i){
cli_list_free_proc(list, procs_to_free[i]); cli_list_free_proc(list, procs_to_free[i]);
} }