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:
parent
d44806f746
commit
f8860c385e
2
bp.c
2
bp.c
@ -562,4 +562,4 @@ int main(int argc, char *argv[])
|
|||||||
exit(found > 0 ? EXIT_SUCCESS : EXIT_FAILURE);
|
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
|
||||||
|
@ -68,4 +68,4 @@ def_t *free_defs(def_t *defs, def_t *stop)
|
|||||||
return defs;
|
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
|
||||||
|
@ -17,4 +17,4 @@ __attribute__((nonnull(1)))
|
|||||||
def_t *free_defs(def_t *defs, def_t *stop);
|
def_t *free_defs(def_t *defs, def_t *stop);
|
||||||
|
|
||||||
#endif
|
#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
|
||||||
|
@ -169,3 +169,5 @@ void explain_match(match_t *m)
|
|||||||
_explain_matches(&first, 0, m->start, (size_t)(m->end - m->start));
|
_explain_matches(&first, 0, m->start, (size_t)(m->end - m->start));
|
||||||
printf("\033[?7h"); // Re-enable line wrapping
|
printf("\033[?7h"); // Re-enable line wrapping
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0
|
||||||
|
@ -10,4 +10,4 @@ __attribute__((nonnull))
|
|||||||
void explain_match(match_t *m);
|
void explain_match(match_t *m);
|
||||||
|
|
||||||
#endif
|
#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
files.c
2
files.c
@ -383,4 +383,4 @@ void cache_destroy(file_t *f)
|
|||||||
f->cache.size = 0;
|
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
|
||||||
|
2
files.h
2
files.h
@ -53,4 +53,4 @@ __attribute__((nonnull))
|
|||||||
void cache_destroy(file_t *f);
|
void cache_destroy(file_t *f);
|
||||||
|
|
||||||
#endif
|
#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
2
json.c
@ -52,4 +52,4 @@ void json_match(const char *text, match_t *m, bool verbose)
|
|||||||
(void)_json_match(text, m, 0, 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
2
json.h
@ -12,4 +12,4 @@ __attribute__((nonnull))
|
|||||||
void json_match(const char *text, match_t *m, bool verbose);
|
void json_match(const char *text, match_t *m, bool verbose);
|
||||||
|
|
||||||
#endif
|
#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
|
||||||
|
4
match.c
4
match.c
@ -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;
|
return (str == f->start || str[-1] == '\n') ? new_match(defs, pat, str, str, NULL) : NULL;
|
||||||
}
|
}
|
||||||
case BP_END_OF_FILE: {
|
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: {
|
case BP_END_OF_LINE: {
|
||||||
return (str == f->end || *str == '\n') ? new_match(defs, pat, str, str, NULL) : NULL;
|
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;
|
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
|
||||||
|
2
match.h
2
match.h
@ -22,4 +22,4 @@ size_t free_all_matches(void);
|
|||||||
size_t recycle_all_matches(void);
|
size_t recycle_all_matches(void);
|
||||||
|
|
||||||
#endif
|
#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
|
||||||
|
@ -600,4 +600,4 @@ pat_t *bp_pattern(file_t *f, const char *str)
|
|||||||
return bp_pattern_nl(f, str, false);
|
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
|
||||||
|
@ -21,4 +21,4 @@ __attribute__((nonnull))
|
|||||||
pat_t *bp_pattern(file_t *f, const char *str);
|
pat_t *bp_pattern(file_t *f, const char *str);
|
||||||
|
|
||||||
#endif
|
#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
print.c
2
print.c
@ -266,4 +266,4 @@ int print_errors(file_t *f, match_t *m)
|
|||||||
return ret;
|
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
|
||||||
|
2
print.h
2
print.h
@ -28,4 +28,4 @@ __attribute__((nonnull))
|
|||||||
int print_errors(file_t *f, match_t *m);
|
int print_errors(file_t *f, match_t *m);
|
||||||
|
|
||||||
#endif
|
#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
types.h
2
types.h
@ -130,4 +130,4 @@ typedef struct def_s {
|
|||||||
} def_t;
|
} def_t;
|
||||||
|
|
||||||
#endif
|
#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
2
utf8.c
@ -280,4 +280,4 @@ bool isidcontinue(file_t *f, const char *str)
|
|||||||
|| find_in_ranges(codepoint, XID_Continue_only, ARRAY_LEN(XID_Continue_only)));
|
|| 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
2
utf8.h
@ -18,4 +18,4 @@ __attribute__((nonnull, pure))
|
|||||||
bool isidcontinue(file_t *f, const char *str);
|
bool isidcontinue(file_t *f, const char *str);
|
||||||
|
|
||||||
#endif
|
#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
|
||||||
|
5
utils.c
5
utils.c
@ -119,11 +119,10 @@ char unescapechar(const char *escaped, const char **end)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default:
|
||||||
if (end) *end = escaped;
|
if (end) *end = escaped;
|
||||||
return (char)0;
|
return (char)0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (end) *end = &escaped[len];
|
if (end) *end = &escaped[len];
|
||||||
return (char)ret;
|
return (char)ret;
|
||||||
}
|
}
|
||||||
@ -151,4 +150,4 @@ void delete(void *p)
|
|||||||
*((void**)p) = NULL;
|
*((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
|
||||||
|
Loading…
Reference in New Issue
Block a user