summary refs log tree commit diff
path: root/bin/hilex/hilex.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-12-28 22:44:25 -0500
committerJune McEnroe <june@causal.agency>2020-12-28 22:48:06 -0500
commit61acea4f1e463303ecad7c7ebf4f85dfe9253c13 (patch)
treec5a7b55f4566721c61608c36bba056d552d8cbd8 /bin/hilex/hilex.c
parentLex strings inside macros (diff)
downloadsrc-61acea4f1e463303ecad7c7ebf4f85dfe9253c13.tar.gz
src-61acea4f1e463303ecad7c7ebf4f85dfe9253c13.zip
Add mdoc lexer
Diffstat (limited to 'bin/hilex/hilex.c')
-rw-r--r--bin/hilex/hilex.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/hilex/hilex.c b/bin/hilex/hilex.c
index 5b40f280..6e308249 100644
--- a/bin/hilex/hilex.c
+++ b/bin/hilex/hilex.c
@@ -32,6 +32,7 @@ static const struct {
 	const char *pattern;
 } Lexers[] = {
 	{ &LexC, "c", "[.][chlmy]$" },
+	{ &LexMdoc, "mdoc", "[.][1-9]$" },
 	{ &LexText, "text", "[.]txt$" },
 };
 
@@ -123,6 +124,7 @@ int main(int argc, char *argv[]) {
 	*lexer->in = file;
 	if (formatter->header) formatter->header(NULL);
 	for (enum Class class; None != (class = lexer->lex());) {
+		assert(class < ClassCap);
 		formatter->format(NULL, class, *lexer->text);
 	}
 	if (formatter->footer) formatter->footer(NULL);