changeset 1046:8fc354b3e198

irccd: improve non-quoted strings support
author David Demelier <markand@malikania.fr>
date Sun, 20 Jun 2021 09:13:56 +0200
parents 13e374b9c522
children d7764d6cdab8
files irccd/lex.l
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/irccd/lex.l	Sun Jun 20 09:13:37 2021 +0200
+++ b/irccd/lex.l	Sun Jun 20 09:13:56 2021 +0200
@@ -30,6 +30,9 @@
 
 #include "conf.h"
 
+void
+yyerror(const char *);
+
 %}
 
 channels        channels
@@ -70,8 +73,9 @@
 ws              [ \t\n]+
 comment         #.*$
 number          [0-9]+
-word            [A-Za-z_][A-Za-z0-9_-]+
+word            [A-Za-z_][^{};,"\r\n\t ]*
 string          \"([^\\\"]|\\.)*\"
+catchall        .
 
 %%
 
@@ -148,4 +152,9 @@
                                 return T_NUMBER;
                         }
 
+{catchall}              {
+                                yyerror("unexpected token");
+                                return -1;
+                        }
+
 %%