summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-02-18 21:07:46 -0500
committerJune McEnroe <june@causal.agency>2019-02-18 21:07:46 -0500
commit8f027a00b050ca0a24c1cc694ae9264c7f6c803f (patch)
tree77d5c9a562ef5d851a0e6d59b1bce61d55a276cd
parentMatch whitespace between * [] {} (diff)
downloadsrc-8f027a00b050ca0a24c1cc694ae9264c7f6c803f.tar.gz
src-8f027a00b050ca0a24c1cc694ae9264c7f6c803f.zip
Don't match nested parentheses in Tag for C
Fixes mistaken highlight of:

    pngWrite(file, (uint8_t []) { 0, 0, 0 }, 3);
-rw-r--r--bin/hi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/hi.c b/bin/hi.c
index a60a0064..8b4bb5c9 100644
--- a/bin/hi.c
+++ b/bin/hi.c
@@ -94,7 +94,7 @@ static const struct Syntax CSyntax[] = {
 	{ Tag, .subexp = 2,
 		.pattern = "(enum|struct|union)" SP1 "(" PATTERN_ID ")" SP0 "[{]" },
 	{ Tag, .parent = ~SET(Keyword), .newline = true, .subexp = 1,
-		.pattern = "(" PATTERN_ID ")" SP0 "[(][^)]*[)]" SP0 "[{]" },
+		.pattern = "(" PATTERN_ID ")" SP0 "[(][^()]*[)]" SP0 "[{]" },
 	{ Tag, .newline = true, .subexp = 3, .pattern =
 		"(static|typedef)" SP1
 		"(" "(" PATTERN_ID ")" SP0