From 9c54e90449677f6ea47dfd5b02d77385f87ade3c Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Tue, 29 Dec 2020 15:05:39 -0500 Subject: Match function-like macro definitions as IdentifierTag --- bin/hilex/c.l | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/hilex/c.l b/bin/hilex/c.l index 056867ce..3b0bcab3 100644 --- a/bin/hilex/c.l +++ b/bin/hilex/c.l @@ -21,7 +21,7 @@ #include "hilex.h" %} -%s MacroLine MacroInclude +%s MacroLine MacroInclude MacroDefine %x CharLiteral StringLiteral ident [_[:alpha:]][_[:alnum:]]* @@ -36,6 +36,10 @@ width "*"|[0-9]+ BEGIN(pop = MacroInclude); return Macro; } +^"#"[[:blank:]]*"define" { + BEGIN(pop = MacroDefine); + return Macro; +} ^[#%][[:blank:]]*{ident} { BEGIN(pop = MacroLine); return Macro; @@ -43,7 +47,18 @@ width "*"|[0-9]+ "<"[^>]+">" { return String; } -{ +{ + {ident}/"(" { + BEGIN(pop = MacroLine); + return IdentifierTag; + } + {ident} { + BEGIN(pop = MacroLine); + return Macro; + } +} + +{ "\n" { BEGIN(pop = INITIAL); return Normal; @@ -70,7 +85,7 @@ register|restrict|return|static|struct|switch|typedef|union|volatile|while | return Keyword; } -{ident} { return Macro; } +{ident} { return Macro; } {ident} { return Identifier; } "//"([^\n]|"\\\n")* | @@ -118,7 +133,7 @@ register|restrict|return|static|struct|switch|typedef|union|volatile|while | [^%\\""]+|. { return String; } } -. { return Macro; } +. { return Macro; } .|\n { return Normal; } -- cgit 1.4.1 ' name='q' value=''/>
path: root/www (unfollow)
Commit message (Expand)Author
2024-08-09Add photos from July 29June McEnroe
2024-08-08Add photos from July 27June McEnroe
2024-07-26Add photos from July 14June McEnroe
2024-07-16Add photos from July 9June McEnroe
2024-07-15Add photos from July 6June McEnroe
2024-07-10Add the end of the Harman Phoenix rollJune McEnroe
2024-07-08Add photos from July 3, the hikeJune McEnroe
2024-07-07Add photos from July 1June McEnroe
2024-07-07Add photos from June 25-30June McEnroe
2024-06-30Add photos from June 22 (and the few days after that)June McEnroe
2024-06-30Accommodate lower-case .jpg filesJune McEnroe
2024-06-23Add another BACKXWASH showJune McEnroe
2024-06-16Update bioJune McEnroe
2024-06-15Add photo descriptions from June 12June McEnroe
2024-06-10Add first roll of film from June 8June McEnroe
2024-06-10Cope with not having an EXIF infoJune McEnroe
2024-06-10Resize using target pixel counts for consistencyJune McEnroe
2024-06-10Add The Girl Who Was Convinced...June McEnroe
2024-06-09Add photos from May 31June McEnroe
2024-06-09Use monospace on photo pagesJune McEnroe
2024-06-09Put lens and (future) film at the tops of photo pagesJune McEnroe
2024-05-22Remove use of sysexits.hJune McEnroe
2024-05-22Add photo descriptions from 05-03 and 05-06June McEnroe
2024-05-21Fix = precedence in whenJune McEnroe