finished up string docs, enhanced the match check rule
This commit is contained in:
parent
37a8609e5b
commit
92014e2ee8
761
4coder_API.html
761
4coder_API.html
File diff suppressed because it is too large
Load Diff
|
@ -283,9 +283,18 @@ parse_error(String line, Jump_Location *location,
|
|||
|
||||
else{
|
||||
int colon_pos1 = find(line, 0, ':');
|
||||
if (colon_pos1 == 1){
|
||||
if (line.size > colon_pos1+1){
|
||||
if (char_is_slash(line.str[colon_pos1+1])){
|
||||
colon_pos1 = find(line, colon_pos1+1, ':');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int colon_pos2 = find(line, colon_pos1+1, ':');
|
||||
int colon_pos3 = find(line, colon_pos2+1, ':');
|
||||
|
||||
|
||||
if (gcc_style_verify(line, colon_pos3)){
|
||||
String filename = substr(line, 0, colon_pos1);
|
||||
String line_number = substr(line, colon_pos1+1, colon_pos2 - colon_pos1 - 1);
|
||||
|
|
|
@ -207,12 +207,23 @@ match_check(Application_Links *app, Search_Range *range, int *pos, Search_Match
|
|||
}
|
||||
}
|
||||
else{
|
||||
char prev = buffer_get_char(app, &result.buffer, result.start - 1);
|
||||
char first = word.str[0];
|
||||
|
||||
char prev = ' ';
|
||||
if (char_is_alpha_numeric(first)){
|
||||
prev = buffer_get_char(app, &result.buffer, result.start - 1);
|
||||
}
|
||||
|
||||
if (!char_is_alpha_numeric(prev)){
|
||||
result.end = result.start + word.size;
|
||||
if (result.end <= end_pos){
|
||||
char next = buffer_get_char(app, &result.buffer, result.end);
|
||||
char last = word.str[word.size-1];
|
||||
|
||||
char next = ' ';
|
||||
if (char_is_alpha_numeric(last)){
|
||||
next = buffer_get_char(app, &result.buffer, result.end);
|
||||
}
|
||||
|
||||
if (!char_is_alpha_numeric(next)){
|
||||
result.found_match = true;
|
||||
found_match = FindResult_FoundMatch;
|
||||
|
|
155
4coder_string.h
155
4coder_string.h
|
@ -40,17 +40,16 @@ struct Offset_String{
|
|||
#ifndef FCODER_STRING_H
|
||||
#define FCODER_STRING_H
|
||||
|
||||
FSTRING_INLINE fstr_bool char_not_slash(char c);
|
||||
FSTRING_INLINE fstr_bool char_is_slash(char c);
|
||||
FSTRING_INLINE char char_to_upper(char c);
|
||||
FSTRING_INLINE char char_to_lower(char c);
|
||||
FSTRING_INLINE fstr_bool char_is_whitespace(char c);
|
||||
FSTRING_INLINE fstr_bool char_is_alpha_numeric(char c);
|
||||
FSTRING_INLINE fstr_bool char_is_hex(char c);
|
||||
FSTRING_INLINE fstr_bool char_is_numeric(char c);
|
||||
FSTRING_INLINE fstr_bool char_is_alpha_numeric_true(char c);
|
||||
FSTRING_INLINE fstr_bool char_is_alpha(char c);
|
||||
FSTRING_INLINE fstr_bool char_is_alpha_true(char c);
|
||||
FSTRING_INLINE fstr_bool char_is_alpha_numeric_true(char c);
|
||||
FSTRING_INLINE fstr_bool char_is_hex(char c);
|
||||
FSTRING_INLINE fstr_bool char_is_numeric(char c);
|
||||
FSTRING_INLINE String string_zero();
|
||||
FSTRING_INLINE String make_string(void *str, int32_t size, int32_t mem_size);
|
||||
FSTRING_INLINE String make_string(void *str, int32_t size);
|
||||
|
@ -67,10 +66,10 @@ FSTRING_LINK int32_t str_size(char *str);
|
|||
FSTRING_INLINE String make_string_slowly(void *str);
|
||||
FSTRING_INLINE String substr(String str, int32_t start);
|
||||
FSTRING_INLINE String substr(String str, int32_t start, int32_t size);
|
||||
FSTRING_INLINE String tailstr(String str);
|
||||
FSTRING_LINK String skip_whitespace(String str);
|
||||
FSTRING_LINK String chop_whitespace(String str);
|
||||
FSTRING_LINK String skip_chop_whitespace(String str);
|
||||
FSTRING_INLINE String tailstr(String str);
|
||||
FSTRING_LINK fstr_bool match(char *a, char *b);
|
||||
FSTRING_LINK fstr_bool match(String a, char *b);
|
||||
FSTRING_INLINE fstr_bool match(char *a, String b);
|
||||
|
@ -109,7 +108,7 @@ FSTRING_INLINE fstr_bool has_substr(String s, String seek);
|
|||
FSTRING_INLINE fstr_bool has_substr_insensitive(char *s, String seek);
|
||||
FSTRING_INLINE fstr_bool has_substr_insensitive(String s, String seek);
|
||||
FSTRING_LINK int32_t copy_fast_unsafe(char *dest, char *src);
|
||||
FSTRING_LINK void copy_fast_unsafe(char *dest, String src);
|
||||
FSTRING_LINK int32_t copy_fast_unsafe(char *dest, String src);
|
||||
FSTRING_LINK fstr_bool copy_checked(String *dest, String src);
|
||||
FSTRING_LINK fstr_bool copy_partial(String *dest, char *src);
|
||||
FSTRING_LINK fstr_bool copy_partial(String *dest, String src);
|
||||
|
@ -160,78 +159,81 @@ FSTRING_LINK fstr_bool string_set_match(String *str_set, int32_t count, S
|
|||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE fstr_bool
|
||||
char_not_slash(char c){
|
||||
return (c != '\\' && c != '/');
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE fstr_bool
|
||||
char_is_slash(char c){
|
||||
char_is_slash(char c)
|
||||
{
|
||||
return (c == '\\' || c == '/');
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE char
|
||||
char_to_upper(char c){
|
||||
char_to_upper(char c)
|
||||
{
|
||||
return (c >= 'a' && c <= 'z') ? c + (char)('A' - 'a') : c;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE char
|
||||
char_to_lower(char c){
|
||||
char_to_lower(char c)
|
||||
{
|
||||
return (c >= 'A' && c <= 'Z') ? c - (char)('A' - 'a') : c;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE fstr_bool
|
||||
char_is_whitespace(char c){
|
||||
char_is_whitespace(char c)
|
||||
{
|
||||
return (c == ' ' || c == '\n' || c == '\r' || c == '\t');
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE fstr_bool
|
||||
char_is_alpha_numeric(char c){
|
||||
char_is_alpha_numeric(char c)
|
||||
{
|
||||
return (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' || c == '_');
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE fstr_bool
|
||||
char_is_hex(char c){
|
||||
return c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f';
|
||||
char_is_alpha_numeric_true(char c)
|
||||
{
|
||||
return (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9');
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE fstr_bool
|
||||
char_is_numeric(char c){
|
||||
return (c >= '0' && c <= '9');
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE fstr_bool
|
||||
char_is_alpha(char c){
|
||||
char_is_alpha(char c)
|
||||
{
|
||||
return (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '_');
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE fstr_bool
|
||||
char_is_alpha_true(char c){
|
||||
char_is_alpha_true(char c)
|
||||
{
|
||||
return (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z');
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE fstr_bool
|
||||
char_is_alpha_numeric_true(char c){
|
||||
return (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9');
|
||||
char_is_hex(char c)
|
||||
{
|
||||
return c >= '0' && c <= '9' || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f';
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE fstr_bool
|
||||
char_is_numeric(char c)
|
||||
{
|
||||
return (c >= '0' && c <= '9');
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -242,7 +244,8 @@ char_is_alpha_numeric_true(char c){
|
|||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE String
|
||||
string_zero(){
|
||||
string_zero()
|
||||
{
|
||||
String str={0};
|
||||
return(str);
|
||||
}
|
||||
|
@ -250,7 +253,8 @@ string_zero(){
|
|||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE String
|
||||
make_string(void *str, int32_t size, int32_t mem_size){
|
||||
make_string(void *str, int32_t size, int32_t mem_size)
|
||||
{
|
||||
String result;
|
||||
result.str = (char*)str;
|
||||
result.size = size;
|
||||
|
@ -272,7 +276,8 @@ make_string(void *str, int32_t size){
|
|||
|
||||
#ifdef FSTRING_IMPLEMENTATION
|
||||
FSTRING_LINK int32_t
|
||||
str_size(char *str){
|
||||
str_size(char *str)
|
||||
{
|
||||
int32_t i = 0;
|
||||
while (str[i]) ++i;
|
||||
return i;
|
||||
|
@ -281,7 +286,8 @@ str_size(char *str){
|
|||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE String
|
||||
make_string_slowly(void *str){
|
||||
make_string_slowly(void *str)
|
||||
{
|
||||
String result;
|
||||
result.str = (char*)str;
|
||||
result.size = str_size((char*)str);
|
||||
|
@ -292,11 +298,12 @@ make_string_slowly(void *str){
|
|||
|
||||
// TODO(allen): I don't love the substr rule, I chose
|
||||
// substr(String, start) and substr(String, start, size)
|
||||
// but I wish I had substr(String, end) and substr(String, start, end)
|
||||
// but I wish I had substr(String, start) and substr(String, start, end)
|
||||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE String
|
||||
substr(String str, int32_t start){
|
||||
substr(String str, int32_t start)
|
||||
{
|
||||
String result;
|
||||
result.str = str.str + start;
|
||||
result.size = str.size - start;
|
||||
|
@ -307,7 +314,8 @@ substr(String str, int32_t start){
|
|||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE String
|
||||
substr(String str, int32_t start, int32_t size){
|
||||
substr(String str, int32_t start, int32_t size)
|
||||
{
|
||||
String result;
|
||||
result.str = str.str + start;
|
||||
result.size = size;
|
||||
|
@ -319,20 +327,10 @@ substr(String str, int32_t start, int32_t size){
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE String
|
||||
tailstr(String str){
|
||||
String result;
|
||||
result.str = str.str + str.size;
|
||||
result.memory_size = str.memory_size - str.size;
|
||||
result.size = 0;
|
||||
return(result);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FSTRING_IMPLEMENTATION
|
||||
FSTRING_LINK String
|
||||
skip_whitespace(String str){
|
||||
skip_whitespace(String str)
|
||||
{
|
||||
String result = {0};
|
||||
int i = 0;
|
||||
for (; i < str.size && char_is_whitespace(str.str[i]); ++i);
|
||||
|
@ -343,7 +341,8 @@ skip_whitespace(String str){
|
|||
|
||||
#ifdef FSTRING_IMPLEMENTATION
|
||||
FSTRING_LINK String
|
||||
chop_whitespace(String str){
|
||||
chop_whitespace(String str)
|
||||
{
|
||||
String result = {0};
|
||||
int i = str.size;
|
||||
for (; i > 0 && char_is_whitespace(str.str[i-1]); --i);
|
||||
|
@ -354,13 +353,26 @@ chop_whitespace(String str){
|
|||
|
||||
#ifdef FSTRING_IMPLEMENTATION
|
||||
FSTRING_LINK String
|
||||
skip_chop_whitespace(String str){
|
||||
skip_chop_whitespace(String str)
|
||||
{
|
||||
str = skip_whitespace(str);
|
||||
str = chop_whitespace(str);
|
||||
return(str);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FSTRING_GUARD
|
||||
FSTRING_INLINE String
|
||||
tailstr(String str)
|
||||
{
|
||||
String result;
|
||||
result.str = str.str + str.size;
|
||||
result.memory_size = str.memory_size - str.size;
|
||||
result.size = 0;
|
||||
return(result);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// String Comparison
|
||||
|
@ -914,18 +926,19 @@ copy_fast_unsafe(char *dest, char *src){
|
|||
++dest;
|
||||
++src;
|
||||
}
|
||||
return (int)(dest - start);
|
||||
return (int32_t)(dest - start);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FSTRING_IMPLEMENTATION
|
||||
FSTRING_LINK void
|
||||
FSTRING_LINK int32_t
|
||||
copy_fast_unsafe(char *dest, String src){
|
||||
int32_t i = 0;
|
||||
while (i != src.size){
|
||||
dest[i] = src.str[i];
|
||||
++i;
|
||||
}
|
||||
return(src.size);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -967,23 +980,17 @@ copy_partial(String *dest, char *src){
|
|||
#ifdef FSTRING_IMPLEMENTATION
|
||||
FSTRING_LINK fstr_bool
|
||||
copy_partial(String *dest, String src){
|
||||
fstr_bool result;
|
||||
int32_t memory_size = dest->memory_size;
|
||||
char *dest_str = dest->str;
|
||||
if (memory_size < src.size){
|
||||
result = 0;
|
||||
for (int32_t i = 0; i < memory_size; ++i){
|
||||
dest_str[i] = src.str[i];
|
||||
}
|
||||
dest->size = memory_size;
|
||||
int32_t memory_size = dest->memory_size;
|
||||
fstr_bool result = false;
|
||||
if (memory_size >= src.size){
|
||||
result = true;
|
||||
memory_size = src.size;
|
||||
}
|
||||
else{
|
||||
result = 1;
|
||||
for (int32_t i = 0; i < src.size; ++i){
|
||||
dest_str[i] = src.str[i];
|
||||
}
|
||||
dest->size = src.size;
|
||||
for (int32_t i = 0; i < memory_size; ++i){
|
||||
dest_str[i] = src.str[i];
|
||||
}
|
||||
dest->size = memory_size;
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
@ -1069,7 +1076,8 @@ append(String *dest, char *src){
|
|||
#endif
|
||||
|
||||
#ifdef FSTRING_IMPLEMENTATION
|
||||
FSTRING_LINK fstr_bool terminate_with_null(String *str){
|
||||
FSTRING_LINK fstr_bool
|
||||
terminate_with_null(String *str){
|
||||
fstr_bool result = 0;
|
||||
if (str->size < str->memory_size){
|
||||
str->str[str->size] = 0;
|
||||
|
@ -1084,7 +1092,7 @@ FSTRING_LINK fstr_bool
|
|||
append_padding(String *dest, char c, int32_t target_size){
|
||||
fstr_bool result = 1;
|
||||
int32_t offset = target_size - dest->size;
|
||||
int32_t r;
|
||||
int32_t r = 0;
|
||||
if (offset > 0){
|
||||
for (r = 0; r < offset; ++r){
|
||||
if (append(dest, c) == 0){
|
||||
|
@ -1106,8 +1114,7 @@ append_padding(String *dest, char c, int32_t target_size){
|
|||
FSTRING_LINK void
|
||||
replace_char(String *str, char replace, char with){
|
||||
char *s = str->str;
|
||||
int32_t i;
|
||||
|
||||
int32_t i = 0;
|
||||
for (i = 0; i < str->size; ++i, ++s){
|
||||
if (*s == replace) *s = with;
|
||||
}
|
||||
|
@ -1364,7 +1371,7 @@ str_to_int(String str){
|
|||
#ifdef FSTRING_IMPLEMENTATION
|
||||
FSTRING_LINK int32_t
|
||||
hexchar_to_int(char c){
|
||||
int32_t x;
|
||||
int32_t x = 0;
|
||||
if (c >= '0' && c <= '9'){
|
||||
x = c-'0';
|
||||
}
|
||||
|
@ -1461,7 +1468,7 @@ hexstr_to_color(String s, uint32_t *out){
|
|||
FSTRING_LINK int32_t
|
||||
reverse_seek_slash(String str, int32_t pos){
|
||||
int32_t i = str.size - 1 - pos;
|
||||
while (i >= 0 && char_not_slash(str.str[i])){
|
||||
while (i >= 0 && !char_is_slash(str.str[i])){
|
||||
--i;
|
||||
}
|
||||
return i;
|
||||
|
|
242
4ed_metagen.cpp
242
4ed_metagen.cpp
|
@ -1508,58 +1508,62 @@ do_macro_parse(int *index, Cpp_Token **token_ptr, int count,
|
|||
if (i > 0){
|
||||
Cpp_Token *doc_token = token-1;
|
||||
|
||||
macro_set.doc_string[sig_count] = make_string(file.data + doc_token->start, doc_token->size);
|
||||
String doc_string = make_string(file.data + doc_token->start, doc_token->size);
|
||||
|
||||
for (; i < count; ++i, ++token){
|
||||
if (token->type == CPP_TOKEN_IDENTIFIER){
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (check_and_fix_docs(&doc_string)){
|
||||
macro_set.doc_string[sig_count] = doc_string;
|
||||
|
||||
if (i < count && (token->flags & CPP_TFLAG_PP_BODY)){
|
||||
macro_set.name[sig_count] = make_string(file.data + token->start, token->size);
|
||||
|
||||
++i, ++token;
|
||||
if (i < count){
|
||||
Cpp_Token *args_start_token = token;
|
||||
for (; i < count; ++i, ++token){
|
||||
if (token->type == CPP_TOKEN_PARENTHESE_CLOSE){
|
||||
break;
|
||||
}
|
||||
for (; i < count; ++i, ++token){
|
||||
if (token->type == CPP_TOKEN_IDENTIFIER){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i < count && (token->flags & CPP_TFLAG_PP_BODY)){
|
||||
macro_set.name[sig_count] = make_string(file.data + token->start, token->size);
|
||||
|
||||
++i, ++token;
|
||||
if (i < count){
|
||||
int start = args_start_token->start;
|
||||
int end = token->start + token->size;
|
||||
macro_set.args[sig_count] = make_string(file.data + start, end - start);
|
||||
|
||||
Argument_Breakdown *breakdown = ¯o_set.breakdown[sig_count];
|
||||
*breakdown = do_parameter_parse(file, args_start_token, token);
|
||||
|
||||
++i, ++token;
|
||||
if (i < count){
|
||||
Cpp_Token *body_start = token;
|
||||
|
||||
if (body_start->flags & CPP_TFLAG_PP_BODY){
|
||||
for (; i < count; ++i, ++token){
|
||||
if (!(token->flags & CPP_TFLAG_PP_BODY)){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
--i, --token;
|
||||
|
||||
Cpp_Token *body_end = token;
|
||||
|
||||
start = body_start->start;
|
||||
end = body_end->start + body_end->size;
|
||||
macro_set.body[sig_count] = make_string(file.data + start, end - start);
|
||||
Cpp_Token *args_start_token = token;
|
||||
for (; i < count; ++i, ++token){
|
||||
if (token->type == CPP_TOKEN_PARENTHESE_CLOSE){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
macro_set.is_macro[sig_count] = true;
|
||||
macro_set.valid[sig_count] = true;
|
||||
result = true;
|
||||
if (i < count){
|
||||
int start = args_start_token->start;
|
||||
int end = token->start + token->size;
|
||||
macro_set.args[sig_count] = make_string(file.data + start, end - start);
|
||||
|
||||
Argument_Breakdown *breakdown = ¯o_set.breakdown[sig_count];
|
||||
*breakdown = do_parameter_parse(file, args_start_token, token);
|
||||
|
||||
++i, ++token;
|
||||
if (i < count){
|
||||
Cpp_Token *body_start = token;
|
||||
|
||||
if (body_start->flags & CPP_TFLAG_PP_BODY){
|
||||
for (; i < count; ++i, ++token){
|
||||
if (!(token->flags & CPP_TFLAG_PP_BODY)){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
--i, --token;
|
||||
|
||||
Cpp_Token *body_end = token;
|
||||
|
||||
start = body_start->start;
|
||||
end = body_end->start + body_end->size;
|
||||
macro_set.body[sig_count] = make_string(file.data + start, end - start);
|
||||
}
|
||||
}
|
||||
|
||||
macro_set.is_macro[sig_count] = true;
|
||||
macro_set.valid[sig_count] = true;
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1662,6 +1666,61 @@ print_function_body_code(FILE *file, int *index, Cpp_Token **token_ptr, int coun
|
|||
*token_ptr = token;
|
||||
}
|
||||
|
||||
static void
|
||||
print_function_docs(FILE *file, Partition *part, String name, String doc_string){
|
||||
if (doc_string.size == 0){
|
||||
fprintf(file, "No documentation generated for this function, assume it is non-public.\n");
|
||||
fprintf(stderr, "warning: no documentation string for %.*s\n", name.size, name.str);
|
||||
}
|
||||
|
||||
Documentation doc_ = {0};
|
||||
Documentation *doc = &doc_;
|
||||
|
||||
perform_doc_parse(part, doc_string, doc);
|
||||
|
||||
int doc_param_count = doc->param_count;
|
||||
if (doc_param_count > 0){
|
||||
fprintf(file, DOC_HEAD_OPEN"Parameters"DOC_HEAD_CLOSE);
|
||||
|
||||
for (int j = 0; j < doc_param_count; ++j){
|
||||
String param_name = doc->param_name[j];
|
||||
String param_docs = doc->param_docs[j];
|
||||
|
||||
// TODO(allen): check that param_name is actually
|
||||
// a parameter to this function!
|
||||
|
||||
fprintf(file,
|
||||
"<div>\n"
|
||||
DOC_ITEM_HEAD_OPEN"%.*s"DOC_ITEM_HEAD_CLOSE"\n"
|
||||
"<div style='margin-bottom: 6mm;'>"DOC_ITEM_OPEN"%.*s"DOC_ITEM_CLOSE"</div>\n"
|
||||
"</div>\n",
|
||||
param_name.size, param_name.str,
|
||||
param_docs.size, param_docs.str
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
String ret_doc = doc->return_doc;
|
||||
if (ret_doc.size != 0){
|
||||
fprintf(file, DOC_HEAD_OPEN"Return"DOC_HEAD_CLOSE);
|
||||
fprintf(file,
|
||||
DOC_ITEM_OPEN"%.*s"DOC_ITEM_CLOSE,
|
||||
ret_doc.size, ret_doc.str
|
||||
);
|
||||
}
|
||||
|
||||
String main_doc = doc->main_doc;
|
||||
if (main_doc.size != 0){
|
||||
fprintf(file, DOC_HEAD_OPEN"Description"DOC_HEAD_CLOSE);
|
||||
fprintf(file,
|
||||
DOC_ITEM_OPEN"%.*s"DOC_ITEM_CLOSE,
|
||||
main_doc.size, main_doc.str
|
||||
);
|
||||
}
|
||||
|
||||
print_see_also(file, doc);
|
||||
}
|
||||
|
||||
char*
|
||||
generate_custom_headers(){
|
||||
#define API_H "4coder_custom_api.h"
|
||||
|
@ -2407,6 +2466,7 @@ generate_custom_headers(){
|
|||
"<h2 id='section_%s'>§"MAJOR_SECTION" %s</h2>\n",
|
||||
sections[1].id_string,
|
||||
sections[1].display_string);
|
||||
|
||||
{
|
||||
fprintf(file,
|
||||
"<div><i>\n"
|
||||
|
@ -2504,8 +2564,8 @@ generate_custom_headers(){
|
|||
|
||||
fprintf(file,
|
||||
"<div id='%.*s_doc' style='margin-bottom: 1cm;'>\n"
|
||||
" <h4>§"SECTION".%d: %.*s</h4>\n"
|
||||
" <div style='"CODE_STYLE" "DESCRIPT_SECTION_STYLE"'>",
|
||||
"<h4>§"SECTION".%d: %.*s</h4>\n"
|
||||
"<div style='"CODE_STYLE" "DESCRIPT_SECTION_STYLE"'>",
|
||||
name.size, name.str, i+1,
|
||||
name.size, name.str
|
||||
);
|
||||
|
@ -2513,55 +2573,7 @@ generate_custom_headers(){
|
|||
fprintf(file, "</div>\n");
|
||||
|
||||
String doc_string = function_set.doc_string[i];
|
||||
if (doc_string.size == 0){
|
||||
fprintf(file, "No documentation generated for this function, assume it is non-public.\n");
|
||||
fprintf(stderr, "warning: no documentation string for %.*s\n", name.size, name.str);
|
||||
}
|
||||
|
||||
Documentation *doc = &function_set.doc[i];
|
||||
perform_doc_parse(part, doc_string, doc);
|
||||
|
||||
int doc_param_count = doc->param_count;
|
||||
if (doc_param_count > 0){
|
||||
fprintf(file, DOC_HEAD_OPEN"Parameters"DOC_HEAD_CLOSE);
|
||||
|
||||
for (int j = 0; j < doc_param_count; ++j){
|
||||
String param_name = doc->param_name[j];
|
||||
String param_docs = doc->param_docs[j];
|
||||
|
||||
// TODO(allen): check that param_name is actually
|
||||
// a parameter to this function!
|
||||
|
||||
fprintf(file,
|
||||
"<div>\n"
|
||||
DOC_ITEM_HEAD_OPEN"%.*s"DOC_ITEM_HEAD_CLOSE"\n"
|
||||
"<div style='margin-bottom: 6mm;'>"DOC_ITEM_OPEN"%.*s"DOC_ITEM_CLOSE"</div>\n"
|
||||
"</div>\n",
|
||||
param_name.size, param_name.str,
|
||||
param_docs.size, param_docs.str
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
String ret_doc = doc->return_doc;
|
||||
if (ret_doc.size != 0){
|
||||
fprintf(file, DOC_HEAD_OPEN"Return"DOC_HEAD_CLOSE);
|
||||
fprintf(file,
|
||||
DOC_ITEM_OPEN"%.*s"DOC_ITEM_CLOSE,
|
||||
ret_doc.size, ret_doc.str
|
||||
);
|
||||
}
|
||||
|
||||
String main_doc = doc->main_doc;
|
||||
if (main_doc.size != 0){
|
||||
fprintf(file, DOC_HEAD_OPEN"Description"DOC_HEAD_CLOSE);
|
||||
fprintf(file,
|
||||
DOC_ITEM_OPEN"%.*s"DOC_ITEM_CLOSE,
|
||||
main_doc.size, main_doc.str
|
||||
);
|
||||
}
|
||||
|
||||
print_see_also(file, doc);
|
||||
print_function_docs(file, part, name, doc_string);
|
||||
|
||||
fprintf(file, "</div><hr>\n");
|
||||
}
|
||||
|
@ -2577,8 +2589,8 @@ generate_custom_headers(){
|
|||
|
||||
fprintf(file,
|
||||
"<div id='%.*s_doc' style='margin-bottom: 1cm;'>\n"
|
||||
" <h4>§"SECTION".%d: %.*s</h4>\n"
|
||||
" <div style='"CODE_STYLE" "DESCRIPT_SECTION_STYLE"'>",
|
||||
"<h4>§"SECTION".%d: %.*s</h4>\n"
|
||||
"<div style='"CODE_STYLE" "DESCRIPT_SECTION_STYLE"'>",
|
||||
name.size, name.str, I,
|
||||
name.size, name.str
|
||||
);
|
||||
|
@ -2620,8 +2632,8 @@ generate_custom_headers(){
|
|||
|
||||
fprintf(file,
|
||||
"<div id='%.*s_doc' style='margin-bottom: 1cm;'>\n"
|
||||
" <h4>§"SECTION".%d: %.*s</h4>\n"
|
||||
" <div style='"CODE_STYLE" "DESCRIPT_SECTION_STYLE"'>",
|
||||
"<h4>§"SECTION".%d: %.*s</h4>\n"
|
||||
"<div style='"CODE_STYLE" "DESCRIPT_SECTION_STYLE"'>",
|
||||
name.size, name.str, I,
|
||||
name.size, name.str
|
||||
);
|
||||
|
@ -2681,8 +2693,8 @@ generate_custom_headers(){
|
|||
|
||||
fprintf(file,
|
||||
"<div id='%.*s_doc' style='margin-bottom: 1cm;'>\n"
|
||||
" <h4>§"SECTION".%d: %.*s</h4>\n"
|
||||
" <div style='"CODE_STYLE" "DESCRIPT_SECTION_STYLE"'>",
|
||||
"<h4>§"SECTION".%d: %.*s</h4>\n"
|
||||
"<div style='"CODE_STYLE" "DESCRIPT_SECTION_STYLE"'>",
|
||||
name.size, name.str, I,
|
||||
name.size, name.str
|
||||
);
|
||||
|
@ -2743,8 +2755,8 @@ generate_custom_headers(){
|
|||
String name = member->name;
|
||||
fprintf(file,
|
||||
"<div id='%.*s_doc' style='margin-bottom: 1cm;'>\n"
|
||||
" <h4>§"SECTION".%d: %.*s</h4>\n"
|
||||
" <div style='"CODE_STYLE" "DESCRIPT_SECTION_STYLE"'>",
|
||||
"<h4>§"SECTION".%d: %.*s</h4>\n"
|
||||
"<div style='"CODE_STYLE" "DESCRIPT_SECTION_STYLE"'>",
|
||||
name.size, name.str, I,
|
||||
name.size, name.str
|
||||
);
|
||||
|
@ -2796,6 +2808,20 @@ generate_custom_headers(){
|
|||
#undef SECTION
|
||||
#define SECTION MAJOR_SECTION".1"
|
||||
|
||||
fprintf(file,
|
||||
"<h3>§"SECTION" String Intro</h3>\n"
|
||||
"<ul>\n");
|
||||
|
||||
{
|
||||
fprintf(file,
|
||||
"<div><i>\n"
|
||||
"Coming Soon"
|
||||
"</i><div>\n");
|
||||
}
|
||||
|
||||
#undef SECTION
|
||||
#define SECTION MAJOR_SECTION".2"
|
||||
|
||||
fprintf(file,
|
||||
"<h3>§"SECTION" String Function List</h3>\n"
|
||||
"<ul>\n");
|
||||
|
@ -2828,7 +2854,7 @@ generate_custom_headers(){
|
|||
used_string_count = 0;
|
||||
|
||||
#undef SECTION
|
||||
#define SECTION MAJOR_SECTION".2"
|
||||
#define SECTION MAJOR_SECTION".3"
|
||||
|
||||
fprintf(file,
|
||||
"<h3>§"SECTION" String Function Descriptions</h3>\n"
|
||||
|
@ -2854,8 +2880,8 @@ generate_custom_headers(){
|
|||
}
|
||||
|
||||
fprintf(file,
|
||||
" <h4>§"SECTION".%d: %.*s</h4>\n"
|
||||
" <div style='"CODE_STYLE" "DESCRIPT_SECTION_STYLE"'>\n",
|
||||
"<h4>§"SECTION".%d: %.*s</h4>\n"
|
||||
"<div style='"CODE_STYLE" "DESCRIPT_SECTION_STYLE"'>\n",
|
||||
i+1, name.size, name.str);
|
||||
|
||||
if (string_function_set.is_macro[i]){
|
||||
|
@ -2867,6 +2893,10 @@ generate_custom_headers(){
|
|||
|
||||
fprintf(file, "</div>\n");
|
||||
|
||||
|
||||
String doc_string = string_function_set.doc_string[i];
|
||||
print_function_docs(file, part, name, doc_string);
|
||||
|
||||
fprintf(file, "</div><hr>\n");
|
||||
}
|
||||
}
|
||||
|
|
144
README.txt
144
README.txt
|
@ -1,4 +1,4 @@
|
|||
Distribution Date: 11.7.2016 (dd.mm.yyyy)
|
||||
Distribution Date: 12.7.2016 (dd.mm.yyyy)
|
||||
|
||||
Thank you for contributing to the 4coder project!
|
||||
|
||||
|
@ -27,63 +27,6 @@ if you start digging and pressing hard enough.
|
|||
INSTRUCTIONS FOR USE
|
||||
-----------------------------------------------------
|
||||
|
||||
****Changes in 4.0.7****
|
||||
Right clicking in a buffer now sets the mark.
|
||||
|
||||
alt + d: brings up the debug view from which there are several options:
|
||||
i - input
|
||||
m - memory and threads
|
||||
v - views
|
||||
more debug features coming in the future. This is mostly here so that
|
||||
I can help everyone gather better data for bug reports and get them
|
||||
fixed more easily.
|
||||
|
||||
****Changes in 4.0.5****
|
||||
Improved indentation rule
|
||||
|
||||
****Changes in 4.0.3****
|
||||
4coder now uses 0% CPU when you are not using it.
|
||||
|
||||
There is a scrollbar on files now. (It is not the nicest scrollbar to use in the world,
|
||||
but the real purpose it serves is to indicate where in a file you are. I imagine most
|
||||
scrolling will still happen with the wheel or cursor navigation.)
|
||||
|
||||
File lists are now arrow navigatable and scrollable... these two systems do no work
|
||||
together very well yet.
|
||||
|
||||
Color adjusting is possible again, but the UI is heavily downgraded from the fancieness
|
||||
of the old system.
|
||||
|
||||
While editing:
|
||||
alt + Z: execute command line with the same output buffer and same command
|
||||
as in the previous use of "alt + z".
|
||||
|
||||
****Changes in 4.0.2****
|
||||
The previous file limit of 128 has been raised to something over 8 million.
|
||||
|
||||
A *messages* buffer is now opened on launch to provide some information about
|
||||
new features and messages will be posted there to report events sometimes.
|
||||
|
||||
subst and link directories no longer confuse the system, it treats them as one file.
|
||||
|
||||
on the command line: -f <N> sets the font size, the default is 16
|
||||
|
||||
ctrl + e: centers the view on the cursor
|
||||
|
||||
****Changes in 4.0.0****
|
||||
alt + x: changed to arbitrary command (NOW WORKS ANYWHERE!)
|
||||
Opens a command prompt from which you can execute:
|
||||
"open menu" to open the menu (old behavior of alt+x)
|
||||
"open all code" loads all cpp and h files in current directory
|
||||
"close all code" closes all cpp and h files currently open
|
||||
"open in quotes" opens the file who's name under the cursor is surrounded by quotes
|
||||
"dos lines" dosify the file end of iles
|
||||
"nix lines" nixify the file end of iles
|
||||
|
||||
alt + z: execute arbitrary command-line command
|
||||
Specify an output buffer and a command to execute
|
||||
and the results will be dropped into the specified buffer.
|
||||
|
||||
****Command line options****
|
||||
4ed [<files-to-open>] [options]
|
||||
|
||||
|
@ -101,12 +44,13 @@ and the results will be dropped into the specified buffer.
|
|||
-T -- invoke special tool isntead of launching 4coder normally
|
||||
-T version : prints the 4coder version string
|
||||
|
||||
****Old Information****
|
||||
****Command Bindings****
|
||||
Basic Navigation:
|
||||
mouse click - move cursor
|
||||
mouse left click - move cursor
|
||||
mouse right click - set mark
|
||||
arrows - move cursor
|
||||
home & end - move cursor to beginning/end of line
|
||||
page up & page down - page up & page down respectively
|
||||
page up & page down - move up/down by close to the height of the entire screen
|
||||
control + left/right - move cursor left/right to first whitespace
|
||||
control + up/down - move cursor up or down to first blank line
|
||||
|
||||
|
@ -114,13 +58,21 @@ Fancy Navigation:
|
|||
control + f : begin find mode, uses interaction bar
|
||||
control + r : begin reverse-find mode, uses interaction bar
|
||||
|
||||
control + F : list all locations of a word in all open buffers, uses interaction bar
|
||||
> This command creates a *search* buffer that displays the locations and the line of each
|
||||
> occurence of the requested word. By positioning the cursor and pressing return the user
|
||||
> jump to the word's occurence.
|
||||
|
||||
While in find mode or reverse-find mode, pressing enter ends the mode
|
||||
leaving the cursor wherever the find highlighter is, and pressing escape
|
||||
ends the mode leaving the cursor wherever it was before the find mode began.
|
||||
|
||||
control + g - goto line number
|
||||
control + g - goto line number, uses interaction bar
|
||||
control + m - swap cursor and mark
|
||||
|
||||
control + e - center the view vertically on the cursor
|
||||
control + E - in a view with unwrapped lines move the view to a position just left of the cursor
|
||||
|
||||
Basic Editing:
|
||||
characters keys, delete, and backspace
|
||||
control + c : copy between cursor and mark
|
||||
|
@ -129,29 +81,32 @@ control + v : paste at cursor
|
|||
control + V : use after normal paste to cycle through older copied text
|
||||
control + d : delete between cursor and mark
|
||||
control + SPACE : set mark to cursor
|
||||
control + backspace : backspace one word
|
||||
control + delete : delete one word
|
||||
alt + backspace : snipe one word
|
||||
|
||||
Undo and History:
|
||||
control + z : undo
|
||||
control + y : redo
|
||||
control + Z: undo / history timelines
|
||||
control + h: history back step
|
||||
control + H: history forward step
|
||||
alt + left: increase rewind speed (through undo)
|
||||
alt + right: increase fastforward speed (through redo)
|
||||
alt + down: stop redining / fastforwarding
|
||||
|
||||
Fancy Editing:
|
||||
control + u : to uppercase between cursor and mark
|
||||
control + j : to lowercase between cursor and mark
|
||||
control + q: query replace
|
||||
control + a: replace in range
|
||||
control + =: write increment
|
||||
control + -: decrement increment
|
||||
control + [: write {} pair with cursor in line between
|
||||
control + {: as <control + [> with a semicolon after "}"
|
||||
control + }: as <control + [> with a "break;" after "}"
|
||||
control + 9: wrap the range specified by mark and cursor in parens
|
||||
control + i: wrap the range specified by mark and cursor in #if 0 #endif
|
||||
control + q : query replace
|
||||
control + a : replace in range
|
||||
control + ~ : clean the trailing whitespace off of all lines
|
||||
|
||||
Fancy Editing in Code Files:
|
||||
control + [ : write "{}" pair with cursor in line between
|
||||
control + { : as control + [ with a semicolon after "}"
|
||||
control + } : as control + [ with a "break;" after "}"
|
||||
control + 0 : write "= {0};" at the cursor
|
||||
control + i : wrap the range specified by mark and cursor in #if 0 #endif
|
||||
|
||||
alt + 1 : if cursor is inside a string, treat the string as a filename and
|
||||
> try to open the file with that name in the other panel
|
||||
|
||||
Whitespace Boringness:
|
||||
Typing characters: },],),; and inserting newlines cause the line to autotab
|
||||
|
@ -163,25 +118,42 @@ control + ! : set the flie to nix mode for writing to disk
|
|||
|
||||
Viewing Options:
|
||||
alt + c - open theme selection UI
|
||||
alt + d - open debug view
|
||||
|
||||
control + p : vertically split the current panel (max 16)
|
||||
control + '-' : horizontally split the current panel (max 16)
|
||||
control + _ : horizontally split the current panel (max 16)
|
||||
control + P : close the currently selected panel
|
||||
control + , : switch to another panel
|
||||
|
||||
control + l : toggle line wrapping
|
||||
control + L : toggle end of line mode
|
||||
mode 1: treat all \r\n and all \n as newline, show \r when not followed by \n
|
||||
mode 2: treat all \r and \n as newline
|
||||
mode 3: treat all \n as newline, show all \r
|
||||
control + ? : toggle highlight whitespace mode
|
||||
|
||||
Tools:
|
||||
alt + m : search in the current hot directory and up through all parent
|
||||
f2 : toggle mouse suppresion mode
|
||||
|
||||
alt + s : show the scrollbar in this view
|
||||
alt + w : hide the scrollbar in this view
|
||||
|
||||
Build Tools:
|
||||
alt + m :
|
||||
[On Windows] search in the current hot directory and up through all parent
|
||||
> directories for a build.bat, and execute that bat if it discovered, sending
|
||||
> output to the buffer *compilation*
|
||||
[On Linux] The behavior is similar but the search looks for build.sh and if that
|
||||
> fails it looks for a Makefile
|
||||
|
||||
alt + . : change to the build panel
|
||||
alt + , : close the build panel
|
||||
alt + n : goto the next error listed in the build panel
|
||||
alt + N : goto the previous error listed in the build panel
|
||||
alt + M : goto the first error listed in the build panel
|
||||
|
||||
alt + z : execute any command line command you specify and send the output to the buffer you specify
|
||||
alt + Z : repeat the command previously executed by the alt + z command
|
||||
|
||||
File Managing:
|
||||
control + n : create a new file, begins interactive input mode
|
||||
control + o : open file, begins interactive input mode
|
||||
alt + o : open file in other panel, same as control + o but runs first changes the active view
|
||||
control + O : reopen the current file
|
||||
(discarding any differences the live version has from the file system's version)
|
||||
control + s : save
|
||||
|
@ -190,10 +162,10 @@ control + i : switch active file in this panel, begins interactive input mode
|
|||
control + k : kill (close) a file, begins interactive input mode
|
||||
control + K : kill (close) the file being viewed in the currently active panel
|
||||
|
||||
While in interactive input mode, pressing enter confirms the input for the command, and
|
||||
pressing escape (once) will end the input mode and abort the command. If the file does
|
||||
not exist either the nearest match will be opened, or no file will be opened if none is
|
||||
considered a match. Use backspace to go back through directories.
|
||||
While in interactive input mode, there are several ways to select an option.
|
||||
The options can be clicked. One option is always highlighted and pressing
|
||||
return or tab will select the highlighted option. Arrow keys navigate the
|
||||
highlighted option. Typing in characters narrows down the list of options.
|
||||
|
||||
Menu UI
|
||||
Keyboard options:
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue