Style change: added cino=:0 (i.e. case statements on same indentation as

switch). Also fixed issue where $$ would fail to match with trailing
newline on file
This commit is contained in:
Bruce Hill 2021-08-28 16:05:30 -07:00
parent d44806f746
commit f8860c385e
20 changed files with 699 additions and 698 deletions

2
bp.c
View File

@ -562,4 +562,4 @@ int main(int argc, char *argv[])
exit(found > 0 ? EXIT_SUCCESS : EXIT_FAILURE);
}
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

View File

@ -68,4 +68,4 @@ def_t *free_defs(def_t *defs, def_t *stop)
return defs;
}
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

View File

@ -17,4 +17,4 @@ __attribute__((nonnull(1)))
def_t *free_defs(def_t *defs, def_t *stop);
#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

View File

@ -169,3 +169,5 @@ void explain_match(match_t *m)
_explain_matches(&first, 0, m->start, (size_t)(m->end - m->start));
printf("\033[?7h"); // Re-enable line wrapping
}
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

View File

@ -10,4 +10,4 @@ __attribute__((nonnull))
void explain_match(match_t *m);
#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

View File

@ -383,4 +383,4 @@ void cache_destroy(file_t *f)
f->cache.size = 0;
}
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

View File

@ -53,4 +53,4 @@ __attribute__((nonnull))
void cache_destroy(file_t *f);
#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

2
json.c
View File

@ -52,4 +52,4 @@ void json_match(const char *text, match_t *m, bool verbose)
(void)_json_match(text, m, 0, verbose);
}
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

2
json.h
View File

@ -12,4 +12,4 @@ __attribute__((nonnull))
void json_match(const char *text, match_t *m, bool verbose);
#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

View File

@ -222,7 +222,7 @@ static match_t *match(def_t *defs, file_t *f, const char *str, pat_t *pat, bool
return (str == f->start || str[-1] == '\n') ? new_match(defs, pat, str, str, NULL) : NULL;
}
case BP_END_OF_FILE: {
return (str == f->end) ? new_match(defs, pat, str, str, NULL) : NULL;
return (str == f->end || (str == f->end-1 && *str == '\n')) ? new_match(defs, pat, str, str, NULL) : NULL;
}
case BP_END_OF_LINE: {
return (str == f->end || *str == '\n') ? new_match(defs, pat, str, str, NULL) : NULL;
@ -703,4 +703,4 @@ size_t free_all_matches(void)
return count;
}
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

View File

@ -22,4 +22,4 @@ size_t free_all_matches(void);
size_t recycle_all_matches(void);
#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

View File

@ -600,4 +600,4 @@ pat_t *bp_pattern(file_t *f, const char *str)
return bp_pattern_nl(f, str, false);
}
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

View File

@ -21,4 +21,4 @@ __attribute__((nonnull))
pat_t *bp_pattern(file_t *f, const char *str);
#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

View File

@ -266,4 +266,4 @@ int print_errors(file_t *f, match_t *m)
return ret;
}
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

View File

@ -28,4 +28,4 @@ __attribute__((nonnull))
int print_errors(file_t *f, match_t *m);
#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

View File

@ -130,4 +130,4 @@ typedef struct def_s {
} def_t;
#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

2
utf8.c
View File

@ -280,4 +280,4 @@ bool isidcontinue(file_t *f, const char *str)
|| find_in_ranges(codepoint, XID_Continue_only, ARRAY_LEN(XID_Continue_only)));
}
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

2
utf8.h
View File

@ -18,4 +18,4 @@ __attribute__((nonnull, pure))
bool isidcontinue(file_t *f, const char *str);
#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

View File

@ -119,11 +119,10 @@ char unescapechar(const char *escaped, const char **end)
}
break;
}
default: {
default:
if (end) *end = escaped;
return (char)0;
}
}
if (end) *end = &escaped[len];
return (char)ret;
}
@ -151,4 +150,4 @@ void delete(void *p)
*((void**)p) = NULL;
}
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0

View File

@ -63,4 +63,4 @@ __attribute__((nonnull))
void delete(void *p);
#endif
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0