diff options
author | June McEnroe <june@causal.agency> | 2021-01-02 14:11:06 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2021-01-02 14:11:06 -0500 |
commit | f36404c75a887e9ea6e3eba6a7701e616bf33c5f (patch) | |
tree | 16bc48594a9e5f62c2a40665e6e910eabc43c512 | |
parent | Clean up order lexer (diff) | |
download | src-f36404c75a887e9ea6e3eba6a7701e616bf33c5f.tar.gz src-f36404c75a887e9ea6e3eba6a7701e616bf33c5f.zip |
Tag top-level typedefs the same way as function definitions
Diffstat (limited to '')
-rw-r--r-- | bin/hilex/c.l | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/hilex/c.l b/bin/hilex/c.l index 55f50f09..e89d3adc 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")* | "/*"([^*]|"*"[^/])*"*"+"/" { |