most systems now relying on parse context

master
Allen Webster 2016-09-03 14:57:42 -04:00
parent 554a61d7a0
commit 1c513033cd
5 changed files with 145 additions and 211 deletions

View File

@ -2208,7 +2208,7 @@ GUI_Scroll_Vars scroll_vars;<br>
</div> </div>
<div> <div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>buffer_id</span></div> <div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>buffer_id</span></div>
<div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>If this is not a null summary, and this view looks at a buffer, this is the id of the buffer.</div></div> <div style='margin-bottom: 6mm;'><div style='margin-left: 5mm; margin-right: 5mm;'>If this is not a null summary, then this is the id of the buffer this view currently sees.</div></div>
</div> </div>
<div> <div>
<div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>lock_flags</span></div> <div style='font-family: "Courier New", Courier, monospace; text-align: left;'><span style='font-weight: 600;'>lock_flags</span></div>

View File

@ -614,8 +614,7 @@ struct Buffer_Summary{
/* DOC(View_Summary acts as a handle to a view and describes the state of the view.) /* DOC(View_Summary acts as a handle to a view and describes the state of the view.)
DOC_SEE(Access_Flag) DOC_SEE(Access_Flag)
DOC_SEE(Full_Cursor) DOC_SEE(Full_Cursor) */
*/
struct View_Summary{ struct View_Summary{
/* DOC( /* DOC(
This field indicates whether the View_Summary describes a view that is open in 4coder. This field indicates whether the View_Summary describes a view that is open in 4coder.
@ -627,7 +626,7 @@ struct View_Summary{
If this is a null summary then view_id is 0. If this is a null summary then view_id is 0.
) */ ) */
int32_t view_id; int32_t view_id;
/* DOC(If this is not a null summary, and this view looks at a buffer, this is the id of the buffer.) */ /* DOC(If this is not a null summary, then this is the id of the buffer this view currently sees.) */
int32_t buffer_id; int32_t buffer_id;
/* /*
DOC(If this is not a null summary, this field contains flags describing the protection status of the view.) DOC(If this is not a null summary, this field contains flags describing the protection status of the view.)

View File

@ -28,6 +28,11 @@ typedef struct Out_Context{
String *str; String *str;
} Out_Context; } Out_Context;
static String
get_string(char *data, int32_t start, int32_t end){
return(make_string(data + start, end - start));
}
static int32_t static int32_t
begin_file_out(Out_Context *out_context, char *filename, String *out){ begin_file_out(Out_Context *out_context, char *filename, String *out){
int32_t r = 0; int32_t r = 0;
@ -355,6 +360,7 @@ typedef enum Item_Type{
Item_Typedef, Item_Typedef,
Item_Struct, Item_Struct,
Item_Union, Item_Union,
Item_Enum,
} Item_Type; } Item_Type;
typedef struct Item_Node{ typedef struct Item_Node{
@ -688,24 +694,6 @@ get_lexeme(Cpp_Token token, char *code){
return(str); return(str);
} }
static int32_t
get_type_doc_string(char *data, Cpp_Token *tokens, Cpp_Token *token,
String *doc_string){
int32_t result = false;
if (token > tokens){
Cpp_Token *prev_token = token - 1;
if (prev_token->type == CPP_TOKEN_COMMENT){
*doc_string = get_lexeme(*prev_token, data);
if (check_and_fix_docs(doc_string)){
result = true;
}
}
}
return(result);
}
static Item_Set static Item_Set
allocate_item_set(Partition *part, int32_t count){ allocate_item_set(Partition *part, int32_t count){
Item_Set item_set = {0}; Item_Set item_set = {0};
@ -720,14 +708,16 @@ typedef struct Parse_Context{
Cpp_Token *token_s; Cpp_Token *token_s;
Cpp_Token *token_e; Cpp_Token *token_e;
Cpp_Token *token; Cpp_Token *token;
char *data;
} Parse_Context; } Parse_Context;
static Parse_Context static Parse_Context
setup_parse_context(Cpp_Token_Stack stack){ setup_parse_context(char *data, Cpp_Token_Stack stack){
Parse_Context context; Parse_Context context;
context.token_s = stack.tokens; context.token_s = stack.tokens;
context.token_e = stack.tokens + stack.count; context.token_e = stack.tokens + stack.count;
context.token = context.token_s; context.token = context.token_s;
context.data = data;
return(context); return(context);
} }
@ -782,69 +772,57 @@ set_token(Parse_Context *context, Cpp_Token *token){
return(result); return(result);
} }
// NOTE(allen): This should not be here any more. It was written static int32_t
// simply to transition the system to the Parse_Context. get_doc_string_from_prev(Parse_Context *context, String *doc_string){
static int32_t TRANSITIONAL_INDEX; int32_t result = false;
static int32_t*
get_index(Parse_Context *context, Cpp_Token *token){ if (can_back_step(context)){
if (token) set_token(context, token); Cpp_Token *prev_token = get_token(context) - 1;
TRANSITIONAL_INDEX = (int32_t)(context->token - context->token_s); if (prev_token->type == CPP_TOKEN_COMMENT){
return(&TRANSITIONAL_INDEX); *doc_string = get_lexeme(*prev_token, context->data);
} if (check_and_fix_docs(doc_string)){
result = true;
static Cpp_Token** }
get_ptr(Parse_Context *context){ }
Cpp_Token **result = &context->token; }
return(result); return(result);
} }
static int32_t static int32_t
get_count(Parse_Context *context){ struct_parse(Partition *part, int32_t is_struct,
int32_t result = (int32_t)(context->token_e - context->token_s); Parse_Context *context, Item_Node *top_member);
return(result);
}
static int32_t static int32_t
parse_struct(Partition *part, int32_t is_struct, struct_parse_member(Partition *part, Parse_Context *context, Item_Node *member){
char *data, Cpp_Token *tokens, int32_t count,
Cpp_Token **token_ptr,
Item_Node *top_member);
static int32_t
parse_struct_member(Partition *part,
char *data, Cpp_Token *tokens, int32_t count,
Cpp_Token **token_ptr,
Item_Node *member){
int32_t result = false; int32_t result = false;
Cpp_Token *token = *token_ptr; Cpp_Token *token = get_token(context);
int32_t i = (int32_t)(token - tokens);
String doc_string = {0}; String doc_string = {0};
get_type_doc_string(data, tokens, token, &doc_string); get_doc_string_from_prev(context, &doc_string);
int32_t start_i = i;
Cpp_Token *start_token = token; Cpp_Token *start_token = token;
for (; i < count; ++i, ++token){ for (; (token = get_token(context)) != 0; get_next_token(context)){
if (token->type == CPP_TOKEN_SEMICOLON){ if (token->type == CPP_TOKEN_SEMICOLON){
break; break;
} }
} }
if (i < count){ if (token){
Cpp_Token *token_j = token; String name = {0};
Cpp_Token *token_j = 0;
int32_t nest_level = 0; int32_t nest_level = 0;
for (int32_t j = i; j > start_i; --j, --token_j){
for (; (token_j = get_token(context)) > start_token; get_prev_token(context)){
if (token_j->type == CPP_TOKEN_BRACKET_CLOSE){ if (token_j->type == CPP_TOKEN_BRACKET_CLOSE){
++nest_level; ++nest_level;
} }
else if (token_j->type == CPP_TOKEN_BRACKET_OPEN){ else if (token_j->type == CPP_TOKEN_BRACKET_OPEN){
--nest_level; --nest_level;
if (nest_level < 0){ if (nest_level < 0){
j = start_i;
break; break;
} }
} }
@ -856,21 +834,14 @@ parse_struct_member(Partition *part,
} }
} }
String name = make_string(data + token_j->start, token_j->size); name = skip_chop_whitespace(get_lexeme(*token_j, context->data));
name = skip_chop_whitespace(name);
int32_t type_start = start_token->start; String type = skip_chop_whitespace(get_string(context->data, start_token->start, token_j->start));
int32_t type_end = token_j->start;
String type = make_string(data + type_start, type_end - type_start);
type = skip_chop_whitespace(type);
type_start = token_j->start + token_j->size; String type_postfix =
type_end = token->start; skip_chop_whitespace(get_string(context->data, token_j->start + token_j->size, token->start));
String type_postfix = make_string(data + type_start, type_end - type_start); set_token(context, token+1);
type_postfix = skip_chop_whitespace(type_postfix);
++token;
result = true; result = true;
member->name = name; member->name = name;
@ -881,28 +852,23 @@ parse_struct_member(Partition *part,
member->next_sibling = 0; member->next_sibling = 0;
} }
*token_ptr = token;
return(result); return(result);
} }
static Item_Node* static Item_Node*
parse_struct_next_member(Partition *part, struct_parse_next_member(Partition *part, Parse_Context *context){
char *data, Cpp_Token *tokens, int32_t count,
Cpp_Token **token_ptr){
Item_Node *result = 0; Item_Node *result = 0;
Cpp_Token *token = *token_ptr; Cpp_Token *token = 0;
int32_t i = (int32_t)(token - tokens);
for (; i < count; ++i, ++token){ for (; (token = get_token(context)) != 0; get_next_token(context)){
if (token->type == CPP_TOKEN_IDENTIFIER || if (token->type == CPP_TOKEN_IDENTIFIER ||
(token->flags & CPP_TFLAG_IS_KEYWORD)){ (token->flags & CPP_TFLAG_IS_KEYWORD)){
String lexeme = make_string(data + token->start, token->size); String lexeme = get_lexeme(*token, context->data);
if (match_ss(lexeme, make_lit_string("struct"))){ if (match_ss(lexeme, make_lit_string("struct"))){
Item_Node *member = push_struct(part, Item_Node); Item_Node *member = push_struct(part, Item_Node);
if (parse_struct(part, true, data, tokens, count, &token, member)){ if (struct_parse(part, true, context, member)){
result = member; result = member;
break; break;
} }
@ -912,7 +878,7 @@ parse_struct_next_member(Partition *part,
} }
else if (match_ss(lexeme, make_lit_string("union"))){ else if (match_ss(lexeme, make_lit_string("union"))){
Item_Node *member = push_struct(part, Item_Node); Item_Node *member = push_struct(part, Item_Node);
if (parse_struct(part, false, data, tokens, count, &token, member)){ if (struct_parse(part, false, context, member)){
result = member; result = member;
break; break;
} }
@ -922,7 +888,7 @@ parse_struct_next_member(Partition *part,
} }
else{ else{
Item_Node *member = push_struct(part, Item_Node); Item_Node *member = push_struct(part, Item_Node);
if (parse_struct_member(part, data, tokens, count, &token, member)){ if (struct_parse_member(part, context, member)){
result = member; result = member;
break; break;
} }
@ -936,48 +902,39 @@ parse_struct_next_member(Partition *part,
} }
} }
*token_ptr = token;
return(result); return(result);
} }
static int32_t static int32_t
parse_struct(Partition *part, int32_t is_struct, struct_parse(Partition *part, int32_t is_struct,
char *data, Cpp_Token *tokens, int32_t count, Parse_Context *context, Item_Node *top_member){
Cpp_Token **token_ptr,
Item_Node *top_member){
int32_t result = false; int32_t result = false;
Cpp_Token *token = *token_ptr; Cpp_Token *start_token = get_token(context);
int32_t i = (int32_t)(token - tokens); Cpp_Token *token = 0;
String doc_string = {0}; String doc_string = {0};
get_type_doc_string(data, tokens, token, &doc_string); get_doc_string_from_prev(context, &doc_string);
int32_t start_i = i; for (; (token = get_token(context)) != 0; get_next_token(context)){
for (; i < count; ++i, ++token){
if (token->type == CPP_TOKEN_BRACE_OPEN){ if (token->type == CPP_TOKEN_BRACE_OPEN){
break; break;
} }
} }
if (i < count){ if (token){
Cpp_Token *token_j = token; Cpp_Token *token_j = token;
int32_t j = i;
for (; j > start_i; --j, --token_j){ for (; (token_j = get_token(context)) > start_token; get_prev_token(context)){
if (token_j->type == CPP_TOKEN_IDENTIFIER){ if (token_j->type == CPP_TOKEN_IDENTIFIER){
break; break;
} }
} }
String name = {0}; String name = {0};
if (token_j != start_token){
if (j != start_i){ name = skip_chop_whitespace(get_lexeme(*token_j, context->data));
name = make_string(data + token_j->start, token_j->size);
name = skip_chop_whitespace(name);
} }
String type = {0}; String type = {0};
@ -988,17 +945,15 @@ parse_struct(Partition *part, int32_t is_struct,
type = make_lit_string("union"); type = make_lit_string("union");
} }
++token; set_token(context, token+1);
Item_Node *new_member = Item_Node *new_member = struct_parse_next_member(part, context);
parse_struct_next_member(part, data, tokens, count, &token);
if (new_member){ if (new_member){
top_member->first_child = new_member; top_member->first_child = new_member;
Item_Node *head_member = new_member; Item_Node *head_member = new_member;
for(;;){ for(;;){
new_member = new_member = struct_parse_next_member(part, context);
parse_struct_next_member(part, data, tokens, count, &token);
if (new_member){ if (new_member){
head_member->next_sibling = new_member; head_member->next_sibling = new_member;
head_member = new_member; head_member = new_member;
@ -1009,14 +964,19 @@ parse_struct(Partition *part, int32_t is_struct,
} }
} }
i = (int32_t)(token - tokens); for (; (token = get_token(context)) != 0; get_next_token(context)){
for (; i < count; ++i, ++token){
if (token->type == CPP_TOKEN_SEMICOLON){ if (token->type == CPP_TOKEN_SEMICOLON){
break; break;
} }
} }
++token; ++token;
if (is_struct){
top_member->t = Item_Struct;
}
else{
top_member->t = Item_Union;
}
top_member->name = name; top_member->name = name;
top_member->type = type; top_member->type = type;
top_member->doc_string = doc_string; top_member->doc_string = doc_string;
@ -1025,140 +985,127 @@ parse_struct(Partition *part, int32_t is_struct,
result = true; result = true;
} }
*token_ptr = token;
return(result); return(result);
} }
static int32_t static int32_t
parse_typedef(char *data, Cpp_Token *tokens, int32_t count, typedef_parse(Parse_Context *context, Item_Set item_set, int32_t item_index){
Cpp_Token **token_ptr, Item_Set item_set, int32_t item_index){
int32_t result = false; int32_t result = false;
Cpp_Token *token = *token_ptr; Cpp_Token *token = get_token(context);
int32_t i = (int32_t)(token - tokens);
String doc_string = {0}; String doc_string = {0};
get_type_doc_string(data, tokens, token, &doc_string); get_doc_string_from_prev(context, &doc_string);
int32_t start_i = i;
Cpp_Token *start_token = token; Cpp_Token *start_token = token;
for (; i < count; ++i, ++token){ for (; (token = get_token(context)) != 0; get_next_token(context)){
if (token->type == CPP_TOKEN_SEMICOLON){ if (token->type == CPP_TOKEN_SEMICOLON){
break; break;
} }
} }
if (i < count){ if (token){
Cpp_Token *token_j = token; Cpp_Token *token_j = token;
for (int32_t j = i; j > start_i; --j, --token_j){ for (; (token_j = get_token(context)) > start_token; get_prev_token(context)){
if (token_j->type == CPP_TOKEN_IDENTIFIER){ if (token_j->type == CPP_TOKEN_IDENTIFIER){
break; break;
} }
} }
String name = make_string(data + token_j->start, token_j->size); String name = get_lexeme(*token_j, context->data);
name = skip_chop_whitespace(name);
int32_t type_start = start_token->start + start_token->size; String type = skip_chop_whitespace(
int32_t type_end = token_j->start; get_string(context->data, start_token->start + start_token->size, token_j->start)
String type = make_string(data + type_start, type_end - type_start); );
type = skip_chop_whitespace(type);
result = true; item_set.items[item_index].t = Item_Typedef;
item_set.items[item_index].type = type; item_set.items[item_index].type = type;
item_set.items[item_index].name = name; item_set.items[item_index].name = name;
item_set.items[item_index].doc_string = doc_string; item_set.items[item_index].doc_string = doc_string;
result = true;
} }
*token_ptr = token; set_token(context, token);
return(result); return(result);
} }
static int32_t static int32_t
parse_enum(Partition *part, char *data, enum_parse(Partition *part, Parse_Context *context,
Cpp_Token *tokens, int32_t count,
Cpp_Token **token_ptr,
Item_Set item_set, int32_t item_index){ Item_Set item_set, int32_t item_index){
int32_t result = false; int32_t result = false;
Cpp_Token *token = *token_ptr;
int32_t i = (int32_t)(token - tokens);
String doc_string = {0}; String doc_string = {0};
get_type_doc_string(data, tokens, token, &doc_string); get_doc_string_from_prev(context, &doc_string);
int32_t start_i = i; Cpp_Token *start_token = get_token(context);
Cpp_Token *token = 0;
for (; i < count; ++i, ++token){ for (; (token = get_token(context)) != 0; get_next_token(context)){
if (token->type == CPP_TOKEN_BRACE_OPEN){ if (token->type == CPP_TOKEN_BRACE_OPEN){
break; break;
} }
} }
if (i < count){ if (token){
Cpp_Token *token_j = token; String name = {0};
Cpp_Token *token_j = 0;
for (int32_t j = i; j > start_i; --j, --token_j){ for (; (token_j = get_token(context)) != 0; get_prev_token(context)){
if (token_j->type == CPP_TOKEN_IDENTIFIER){ if (token_j->type == CPP_TOKEN_IDENTIFIER){
break; break;
} }
} }
String name = make_string(data + token_j->start, token_j->size); name = get_lexeme(*token_j, context->data);
name = skip_chop_whitespace(name);
for (; i < count; ++i, ++token){ set_token(context, token);
for (; (token = get_token(context)) > start_token; get_next_token(context)){
if (token->type == CPP_TOKEN_BRACE_OPEN){ if (token->type == CPP_TOKEN_BRACE_OPEN){
break; break;
} }
} }
if (i < count){ if (token){
Item_Node *first_member = 0; Item_Node *first_member = 0;
Item_Node *head_member = 0; Item_Node *head_member = 0;
for (; i < count; ++i, ++token){ for (; (token = get_token(context)) != 0; get_next_token(context)){
if (token->type == CPP_TOKEN_BRACE_CLOSE){ if (token->type == CPP_TOKEN_BRACE_CLOSE){
break; break;
} }
else if (token->type == CPP_TOKEN_IDENTIFIER){ else if (token->type == CPP_TOKEN_IDENTIFIER){
String doc_string = {0}; String doc_string = {0};
get_type_doc_string(data, tokens, token, &doc_string); String name = {0};
String name = make_string(data + token->start, token->size);
name = skip_chop_whitespace(name);
String value = {0}; String value = {0};
get_doc_string_from_prev(context, &doc_string);
++i; name = get_lexeme(*token, context->data);
++token;
if (token->type == CPP_TOKEN_EQ){ token = get_next_token(context);
Cpp_Token *start_token = token;
if (token){
for (; i < count; ++i, ++token){ if (token->type == CPP_TOKEN_EQ){
if (token->type == CPP_TOKEN_COMMA || Cpp_Token *start_token = token;
token->type == CPP_TOKEN_BRACE_CLOSE){
break; for (; (token = get_token(context)) != 0; get_next_token(context)){
if (token->type == CPP_TOKEN_COMMA ||
token->type == CPP_TOKEN_BRACE_CLOSE){
break;
}
} }
value = skip_chop_whitespace(
get_string(context->data, start_token->start + start_token->size, token->start)
);
get_prev_token(context);
}
else{
get_prev_token(context);
} }
int32_t val_start = start_token->start + start_token->size;
int32_t val_end = token->start;
value = make_string(data + val_start, val_end - val_start);
value = skip_chop_whitespace(value);
--i;
--token;
}
else{
--i;
--token;
} }
Item_Node *new_member = push_struct(part, Item_Node); Item_Node *new_member = push_struct(part, Item_Node);
@ -1178,25 +1125,23 @@ parse_enum(Partition *part, char *data,
} }
} }
if (i < count){ if ((token = get_token(context)) != 0){
for (; i < count; ++i, ++token){ for (; (token = get_token(context)) != 0; get_next_token(context)){
if (token->type == CPP_TOKEN_BRACE_CLOSE){ if (token->type == CPP_TOKEN_BRACE_CLOSE){
break; break;
} }
} }
++i; get_next_token(context);
++token;
result = true; item_set.items[item_index].t = Item_Enum;
item_set.items[item_index].name = name; item_set.items[item_index].name = name;
item_set.items[item_index].doc_string = doc_string; item_set.items[item_index].doc_string = doc_string;
item_set.items[item_index].first_child = first_member; item_set.items[item_index].first_child = first_member;
result = true;
} }
} }
} }
*token_ptr = token;
return(result); return(result);
} }
@ -1735,11 +1680,6 @@ string_function_marker_check(String lexeme){
return(result); return(result);
} }
static String
get_string(char *data, int32_t start, int32_t end){
return(make_string(data + start, end - start));
}
static void static void
print_str(FILE *file, String str){ print_str(FILE *file, String str){
if (str.size > 0){ if (str.size > 0){
@ -1897,7 +1837,7 @@ generate_custom_headers(){
Cpp_Token *token = 0; Cpp_Token *token = 0;
Parse_Context context_ = setup_parse_context(string_parse.tokens); Parse_Context context_ = setup_parse_context(data, string_parse.tokens);
Parse_Context *context = &context_; Parse_Context *context = &context_;
for (; (token = get_token(context)) != 0; get_next_token(context)){ for (; (token = get_token(context)) != 0; get_next_token(context)){
@ -1930,7 +1870,7 @@ generate_custom_headers(){
char *data = code->str; char *data = code->str;
Parse_Context context_ = setup_parse_context(*token_stack); Parse_Context context_ = setup_parse_context(data, *token_stack);
Parse_Context *context = &context_; Parse_Context *context = &context_;
String cpp_name = {0}; String cpp_name = {0};
@ -1992,7 +1932,7 @@ generate_custom_headers(){
Cpp_Token *tokens = parse->tokens.tokens; Cpp_Token *tokens = parse->tokens.tokens;
Cpp_Token *token = tokens; Cpp_Token *token = tokens;
Parse_Context context_ = setup_parse_context(parse->tokens); Parse_Context context_ = setup_parse_context(data, parse->tokens);
Parse_Context *context = &context_; Parse_Context *context = &context_;
for (int32_t i = 0; i < count; ++i, ++token){ for (int32_t i = 0; i < count; ++i, ++token){
@ -2019,7 +1959,7 @@ generate_custom_headers(){
char *data = parse->code.str; char *data = parse->code.str;
Parse_Context context_ = setup_parse_context(parse->tokens); Parse_Context context_ = setup_parse_context(data, parse->tokens);
Parse_Context *context = &context_; Parse_Context *context = &context_;
// NOTE(allen): Header Parse // NOTE(allen): Header Parse
@ -2235,58 +2175,52 @@ generate_custom_headers(){
char *data = type_parse[J].code.str; char *data = type_parse[J].code.str;
Cpp_Token_Stack types_tokens = type_parse[J].tokens; Cpp_Token_Stack types_tokens = type_parse[J].tokens;
int32_t count = types_tokens.count; Cpp_Token *token = types_tokens.tokens;
Cpp_Token *tokens = types_tokens.tokens;
Cpp_Token *token = tokens;
for (int32_t i = 0; i < count; ++i, ++token){ Parse_Context context_ = setup_parse_context(data, types_tokens);
Assert(i == (int32_t)(token - tokens)); Parse_Context *context = &context_;
for (; (token = get_token(context)) != 0; get_next_token(context)){
if (!(token->flags & CPP_TFLAG_PP_BODY) && if (!(token->flags & CPP_TFLAG_PP_BODY) &&
(token->type == CPP_TOKEN_KEY_TYPE_DECLARATION || (token->type == CPP_TOKEN_KEY_TYPE_DECLARATION ||
token->type == CPP_TOKEN_IDENTIFIER)){ token->type == CPP_TOKEN_IDENTIFIER)){
String lexeme = make_string(data + token->start, token->size); String lexeme = get_lexeme(*token, data);
int32_t match_index = 0; int32_t match_index = 0;
if (string_set_match(type_spec_keys, ArrayCount(type_spec_keys), if (string_set_match(type_spec_keys, ArrayCount(type_spec_keys),
lexeme, &match_index)){ lexeme, &match_index)){
switch (match_index){ switch (match_index){
case 0: //typedef case 0: //typedef
{ {
if (parse_typedef(data, tokens, count, &token, set_token(context, token);
typedef_set, typedef_index)){ if (typedef_parse(context, typedef_set, typedef_index)){
++typedef_index; ++typedef_index;
} }
i = (int32_t)(token - tokens);
}break; }break;
case 1: case 2: //struct/union case 1: case 2: //struct/union
{ {
if (parse_struct(part, (match_index == 1), set_token(context, token);
data, tokens, count, &token, if (struct_parse(part, (match_index == 1),
struct_set.items + struct_index)){ context, struct_set.items + struct_index)){
++struct_index; ++struct_index;
} }
i = (int32_t)(token - tokens);
}break; }break;
case 3: //ENUM case 3: //ENUM
{ {
if (parse_enum(part, data, set_token(context, token);
tokens, count, &token, if (enum_parse(part, context, enum_set, enum_index)){
enum_set, enum_index)){
++enum_index; ++enum_index;
} }
i = (int32_t)(token - tokens);
}break; }break;
case 4: //FLAGENUM case 4: //FLAGENUM
{ {
if (parse_enum(part, data, set_token(context, token);
tokens, count, &token, if (enum_parse(part, context, flag_set, flag_index)){
flag_set, flag_index)){
++flag_index; ++flag_index;
} }
i = (int32_t)(token - tokens);
}break; }break;
} }
} }

View File

@ -96,6 +96,7 @@
; [] hook on exit ; [] hook on exit
; [] read only files ; [] read only files
; [] occasionally missing the (!) mark on files on windows ; [] occasionally missing the (!) mark on files on windows
; [] don't execute frames on events dealing only with ctrl/alt/shift
; ;
; TODOS ; TODOS

View File

@ -259,7 +259,7 @@ CUSTOM_COMMAND_SIG(mark_matching_brace){
finished: finished:
if (found_result){ if (found_result){
app->view_set_mark(app, &view, seek_pos(result)); app->view_set_mark(app, &view, seek_pos(result+1));
} }
} }