From 321b5f4bc23174d4abacc951cdee45d4f6f5c97d Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Tue, 29 Dec 2020 17:13:26 -0500 Subject: Match top-level C definitions as IdentifierTag --- bin/hilex/c.l | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'bin') diff --git a/bin/hilex/c.l b/bin/hilex/c.l index 1eec5f31..f7370b01 100644 --- a/bin/hilex/c.l +++ b/bin/hilex/c.l @@ -30,6 +30,7 @@ width "*"|[0-9]+ %% static int pop = INITIAL; + static int braces = 0; [[:blank:]]+ { return Normal; } @@ -102,6 +103,11 @@ register|restrict|return|static|struct|switch|typedef|union|volatile|while | {ident} { return Macro; } {ident} { return Identifier; } +{ident}/("["[^]]*"]")*[[:space:]]*"=" | +{ident}/"("[^)]*")"[[:space:]]*"{" { + return (!braces ? IdentifierTag : Identifier); +} + "//"([^\n]|"\\\n")* | "/*"([^*]|"*"[^/])*"*"+"/" { return Comment; @@ -147,6 +153,15 @@ register|restrict|return|static|struct|switch|typedef|union|volatile|while | [^%\\""]+|. { return String; } } +"{" { + braces++; + REJECT; +} +"}" { + braces--; + REJECT; +} + . { return Macro; } .|\n { return Normal; } -- cgit 1.4.1 href='/src/commit/bin/dash/src?id=415cdd3e2f62dc3234d753789d70a059750d09cd&follow=1'>commit diff
Commit message (Expand)Author
2021-02-07Bump font size to 12June McEnroe
2021-02-07Fully configure and rebind cwmJune McEnroe
2021-02-07Add BintiJune McEnroe
2021-02-07Finish configuring xtermJune McEnroe
2021-02-06Enable tapping, reverse scroll, set scaling in wsconsctlJune McEnroe
2021-02-06Set root window to black on purple snowJune McEnroe
2021-02-06Add xmodmap configurationJune McEnroe
2021-02-06Add initial OpenBSD X configurationJune McEnroe
2021-02-06Add xterm output to schemeJune McEnroe