summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-01-02 15:13:07 -0500
committerJune McEnroe <june@causal.agency>2021-01-02 15:13:07 -0500
commit6913d25841016c4ffdccd3b915bdf961090320af (patch)
treecb2eb9a86b05c567e0333c9df4df4e01ae5a4015 /bin
parentTag top-level typedefs the same way as function definitions (diff)
downloadsrc-6913d25841016c4ffdccd3b915bdf961090320af.tar.gz
src-6913d25841016c4ffdccd3b915bdf961090320af.zip
Clean up make lexer
Still feels pretty messy though.
Diffstat (limited to '')
-rw-r--r--bin/hilex/make.l27
1 files changed, 17 insertions, 10 deletions
diff --git a/bin/hilex/make.l b/bin/hilex/make.l
index 00c1acca..31b85574 100644
--- a/bin/hilex/make.l
+++ b/bin/hilex/make.l
@@ -25,14 +25,15 @@
 %x Interp Shell
 
 ident [._[:alnum:]]+
-target [-/._[:alnum:]]+
-assign [!+:?]?=
+assign [+?:!]?=
+target [-._/?*\[\][:alnum:]]+
+operator [:!]|::
 
 %%
 	static int pop = INITIAL;
 	static int depth = 0;
 
-^"\t" {
+^"\t"+ {
 	BEGIN(pop = Shell);
 	return Normal;
 }
@@ -41,12 +42,15 @@ assign [!+:?]?=
 		BEGIN(pop = INITIAL);
 		return Normal;
 	}
-	[^\n$]+|. { return Normal; }
+	"\\\n" { return Normal; }
+	[^\\\n$]+|. { return Normal; }
 }
 
-[[:blank:]] { return Normal; }
+[[:blank:]]+ { return Normal; }
 
-"."(PHONY|PRECIOUS|SUFFIXES)/":"? {
+{operator} { return Operator; }
+
+"."(PHONY|PRECIOUS|SUFFIXES)/{operator}? {
 	return Keyword;
 }
 
@@ -63,16 +67,19 @@ assign [!+:?]?=
 		BEGIN(pop = INITIAL);
 		return Normal;
 	}
-	[^$[:space:]]+ { return String; }
+	"\\\n" { return String; }
+	[^\\$[:space:]]+|. { return String; }
 }
 
-{target}([[:blank:]]+{target})*/":" {
+^"-"?include { return Macro; }
+
+{target}([[:blank:]]+{target})*/{operator} {
 	return IdentifierTag;
 }
 
-^"-"?include { return Macro; }
+{target} { return Identifier; }
 
-"#".* { return Comment; }
+"#"([^\\\n]|"\\"[^\n]|"\\\n")* { return Comment; }
 
 <*>{
 	"$"("{"|"(") {
tle='2019-10-27 01:22:30 -0400'>2019-10-27Add reload cmd to rc scriptJune McEnroe 2019-10-27Reload certificate on SIGUSR1June McEnroe 2019-10-27Drop clients on zero-length readsJune McEnroe 2019-10-27Explicitly tls_handshake new clientsJune McEnroe 2019-10-26Document rationaleJune McEnroe 2019-10-26Handle nick collisionJune McEnroe 2019-10-26Wait for AUTHENTICATE + from serverJune McEnroe 2019-10-26Respond to PING with same parameterJune McEnroe 2019-10-26Add undocumented flag to disable verificationJune McEnroe 2019-10-26Do not require RPL_ISUPPORT for stateReadyJune McEnroe 2019-10-26Implement graceful shutdownJune McEnroe 2019-10-26Require PASS before USERJune McEnroe 2019-10-26Track channel topicsJune McEnroe 2019-10-26Set AWAY when no clients are connectedJune McEnroe 2019-10-26Add flags to request TOPIC and NAMES on client connectJune McEnroe 2019-10-26OopsJune McEnroe 2019-10-26Disconnect client on unknown commandJune McEnroe 2019-10-26Allow reading sensitive information from filesJune McEnroe 2019-10-26Add rc scriptJune McEnroe 2019-10-25Add install and uninstall targetsJune McEnroe 2019-10-25Expand documentationJune McEnroe 2019-10-25Add AGPLv3 notice on client registrationJune McEnroe 2019-10-25Rename project pounceJune McEnroe