From 031bb53552b5b2675b1c3afb57a27b28cb5d379e Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Wed, 24 Jul 2024 11:19:52 +0200 Subject: Add grammar rules to parse the value of a property In the lexer, I've done a string duplication, 'cause the value wasn't transfered to the parser. The VALUE token keep a single character, so, in the parser I need to concatenate every single character to a string. --- properties.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'properties.l') diff --git a/properties.l b/properties.l index 67a5c2a..eb6ff81 100644 --- a/properties.l +++ b/properties.l @@ -5,8 +5,8 @@ %% =|: return DIV; -^[ \t]*[a-zA-Z0-9\.]* return KEY; +^[ \t]*[a-zA-Z0-9\.]* yylval.value = strdup(yytext); return KEY; [ \t]* ; -. return VALUE; +. yylval.value = strdup(yytext); return VALUE; %% -- cgit v1.2.3