summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/Makefile1
-rw-r--r--bin/hilex.c8
-rw-r--r--bin/hilex.h1
-rw-r--r--bin/text.l35
4 files changed, 8 insertions, 37 deletions
diff --git a/bin/Makefile b/bin/Makefile
index 6220ec06..9cdf9848 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -88,7 +88,6 @@ OBJS.hilex += c11.o
 OBJS.hilex += hilex.o
 OBJS.hilex += make.o
 OBJS.hilex += mdoc.o
-OBJS.hilex += text.o
 
 hilex: ${OBJS.hilex}
 	${CC} ${LDFLAGS} ${OBJS.$@} ${LDLIBS.$@} -o $@
diff --git a/bin/hilex.c b/bin/hilex.c
index afcc5000..a5c682ac 100644
--- a/bin/hilex.c
+++ b/bin/hilex.c
@@ -35,6 +35,14 @@ static const char *Class[] = {
 #undef X
 };
 
+static FILE *yyin;
+static char *yytext;
+static int yylex(void) {
+	static size_t cap = 0;
+	return (getline(&yytext, &cap, yyin) < 0 ? None : Normal);
+}
+static const struct Lexer LexText = { yylex, &yyin, &yytext };
+
 static const struct {
 	const struct Lexer *lexer;
 	const char *name;
diff --git a/bin/hilex.h b/bin/hilex.h
index 5998e6a4..2a8d4ec0 100644
--- a/bin/hilex.h
+++ b/bin/hilex.h
@@ -47,4 +47,3 @@ struct Lexer {
 extern const struct Lexer LexC;
 extern const struct Lexer LexMake;
 extern const struct Lexer LexMdoc;
-extern const struct Lexer LexText;
diff --git a/bin/text.l b/bin/text.l
deleted file mode 100644
index e3d64814..00000000
--- a/bin/text.l
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 2020  C. McEnroe <june@causal.agency>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-%option prefix="text"
-%option noyywrap
-
-%{
-#include "hilex.h"
-%}
-
-%%
-
-.*"\n"? { return Normal; }
-
-%{
-	(void)yyunput;
-	(void)input;
-%}
-
-%%
-
-const struct Lexer LexText = { yylex, &yyin, &yytext };
reverts commit 279111dda15dd9170e11b9688eb973f2af2e6300. 2019-09-20Enable cookies in titleJune McEnroe Perhaps this will make it less suspicious to Google. Who knows. 2019-09-16Use sensitivity aliases in TF2June McEnroe 2019-09-16Add The Just CityJune McEnroe 2019-09-12Only GET the final redirect locationJune McEnroe 2019-09-12Consume entire bodyJune McEnroe Aborting the request and leaving data around may be causing intermittent errors. Just discard the rest of the data. 2019-09-10Add title -v flagJune McEnroe 2019-09-10Use curl error bufferJune McEnroe 2019-09-10Set Accept-Encoding in titleJune McEnroe Because apparently it's fine for servers to respond with Content-Encoding you didn't ask for, and curl won't decode it if you didn't ask for it. 2019-09-08Set title User-AgentJune McEnroe Some things don't like you if you don't send one. 2019-09-07Add -x flag to titleJune McEnroe 2019-09-07Ignore SIGPIPE in relayJune McEnroe Allows restarting consumers safely. 2019-09-07Add A Memory Called EmpireJune McEnroe 2019-09-05Handle lack of Content-TypeJune McEnroe 2019-09-05Use CURLINFO_CONTENT_TYPEJune McEnroe Oops, didn't see this. 2019-09-05Decode entities in titlesJune McEnroe 2019-09-05Print title as soon as it's availableJune McEnroe 2019-09-05Use CURL_PREFIX to set flagsJune McEnroe 2019-09-05Add titleJune McEnroe 2019-09-04Add Avorter n'est pas tuerJune McEnroe 2019-08-29Unset executable on shell scriptsJune McEnroe 2019-08-29Add long-missing setopt to bin.7June McEnroe 2019-08-29Add editJune McEnroe