From 9e72c0acce13944e568b1a164058b779a4d537f6 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Tue, 29 Dec 2020 17:44:48 -0500 Subject: Clean up hilex code somewhat --- bin/hilex/hilex.c | 10 +++++++--- bin/hilex/irc.c | 8 ++++---- bin/hilex/mdoc.l | 17 +++++++---------- 3 files changed, 18 insertions(+), 17 deletions(-) (limited to 'bin/hilex') diff --git a/bin/hilex/hilex.c b/bin/hilex/hilex.c index d99b14bb..b2bebd5f 100644 --- a/bin/hilex/hilex.c +++ b/bin/hilex/hilex.c @@ -82,9 +82,13 @@ static const char *ClassName[] = { static void debugFormat(const char *opts[], enum Class class, const char *text) { - printf("%s(\33[3m", ClassName[class]); - FormatANSI.format(opts, class, text); - printf("\33[m)"); + if (class != Normal) { + printf("%s(", ClassName[class]); + FormatANSI.format(opts, class, text); + printf(")"); + } else { + printf("%s", text); + } } const struct Formatter FormatDebug = { .format = debugFormat }; diff --git a/bin/hilex/irc.c b/bin/hilex/irc.c index c760fc26..a83b55e6 100644 --- a/bin/hilex/irc.c +++ b/bin/hilex/irc.c @@ -22,10 +22,10 @@ #include "hilex.h" static const char *IRC[ClassCap] = { - [Keyword] = "\00315", - [Macro] = "\00303", - [Comment] = "\00302", - [String] = "\00310", + [Keyword] = "\00315", + [Macro] = "\0033", + [Comment] = "\0032", + [String] = "\00310", [StringFormat] = "\00311", }; diff --git a/bin/hilex/mdoc.l b/bin/hilex/mdoc.l index 2f01ce2a..4db147c8 100644 --- a/bin/hilex/mdoc.l +++ b/bin/hilex/mdoc.l @@ -25,6 +25,8 @@ %% +[[:blank:]]+ { return Normal; } + ^"." { BEGIN(MacroLine); return Keyword; @@ -32,7 +34,7 @@ ^".\\\"".* { return Comment; } -{ +{ "\n" { BEGIN(0); return Normal; @@ -52,18 +54,13 @@ "\""([^""]|"\\\"")*"\"" { return String; } } -{ - "\n" { - BEGIN(0); - return Normal; - } - - [^[:space:]].* { return IdentifierTag; } -} +[^[:space:]].* { return IdentifierTag; } "\\"(.|"("..|"["[^]]*"]") { return String; } -[[:blank:]]+|[^.\n""\\[:space:]]+|.|\n { return Normal; } +[^.\\""[:space:]]+ { return Normal; } + +.|\n { return Normal; } %{ (void)yyunput; -- cgit 1.4.1 /src/log/bin/.gitignore?id=5dc1f4338a78aea5f14999515af39b2e8fca684e'>unfollow)
Commit message (Expand)Author
2022-09-21Add Take Me ThereJune McEnroe
2022-09-19Add when - to print all named datesJune McEnroe
2022-09-19Publish ApologiesJune McEnroe
2022-09-19Do more "email" filteringJune McEnroe
2022-09-18Add gdbinit, hushlogin, inputrcJune McEnroe
2022-09-18Remove some filesJune McEnroe
2022-09-18Remove doc/pdfJune McEnroe
2022-09-18Fix name in zlib mdoc pagesJune McEnroe
2022-09-11Reread A Closed and Common OrbitJune McEnroe
2022-09-09Add I've Got a Time BombJune McEnroe
2022-09-02Update "Care" with initial electrolysis reportJune McEnroe
2022-08-17Add The Book of Form and EmptinessJune McEnroe
2022-08-15Load dates from ~/.config/when/datesJune McEnroe
2022-08-15Allow names with prefixes of months and daysJune McEnroe
2022-08-15Add named dates to whenJune McEnroe
2022-08-14Remove tweets text fileJune McEnroe
2022-08-09Fix all copyright noticesJune McEnroe
2022-08-04Add Conversations With FriendsJune McEnroe
2022-07-30Add Normal PeopleJune McEnroe
2022-07-26Rewrite glitch from new pngoJune McEnroe
2022-07-26Update Care with time-to-ID and piercingsJune McEnroe
2022-07-26Add -w to upJune McEnroe
2022-07-13Set push.autoSetupRemoteJune McEnroe
2022-07-08Remove TOURJune McEnroe
2022-07-03Add The Bone Shard EmperorJune McEnroe
2022-06-25Bump xterm font size to 12June McEnroe
2022-06-10Handle subshells (and functions) inside substitutionsJune McEnroe
2022-06-10Switch to jorts Install scriptJune McEnroe
2022-06-08Indicate if still reading or no resultsJune McEnroe
2022-06-08Add Maiden, Mother, CroneJune McEnroe
2022-06-05FIRST SHOW IN 2.5 YEARS BABEY!!!June McEnroe
2022-06-03Set line number on File linesJune McEnroe
2022-06-03Stop polling stdin after EOFJune McEnroe
2022-06-02Set TABSIZE=4June McEnroe
2022-06-02Do basic match highlightingJune McEnroe
2022-06-02Clean up parsing a littleJune McEnroe
2022-06-02Don't duplicate path stringJune McEnroe
2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe
2022-06-02Add initial working version of qfJune McEnroe
2022-05-29Set prompt for okshJune McEnroe