summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-01-02 14:11:06 -0500
committerJune McEnroe <june@causal.agency>2021-01-02 14:11:06 -0500
commitcf18f77b4dc6e67abe8d4410552912740c07b409 (patch)
treea548779b248bda142bcdca23b31b80bc6f2daa24 /bin
parentClean up order lexer (diff)
downloadsrc-cf18f77b4dc6e67abe8d4410552912740c07b409.tar.gz
src-cf18f77b4dc6e67abe8d4410552912740c07b409.zip
Tag top-level typedefs the same way as function definitions
Diffstat (limited to 'bin')
-rw-r--r--bin/hilex/c.l5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/hilex/c.l b/bin/hilex/c.l
index 8c4a8ca1..ca99916a 100644
--- a/bin/hilex/c.l
+++ b/bin/hilex/c.l
@@ -55,7 +55,7 @@ enum|struct|typedef|union {
 	BEGIN(TypeDecl);
 	return Keyword;
 }
-<TypeDecl>{ident}/[[:space:]]*("{"|"(") {
+<TypeDecl>{ident}/[[:space:]]*"{" {
 	BEGIN(pop);
 	return IdentifierTag;
 }
@@ -111,6 +111,9 @@ register|restrict|return|static|struct|switch|typedef|union|volatile|while |
 {ident}/"("[^)]*")"[[:space:]]*"{" {
 	return (!depth ? IdentifierTag : Identifier);
 }
+<TypeDecl>{ident}/"("[^)]*");" {
+	return (!depth ? IdentifierTag : Identifier);
+}
 
 "//"([^\n]|"\\\n")* |
 "/*"([^*]|"*"[^/])*"*"+"/" {