aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2024-07-24 12:09:10 +0200
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2024-07-24 12:09:10 +0200
commite92b44754518c11f38df677feb996a5e4cca9f26 (patch)
treee43f8364d13b797017b63043cadf74d6c3f30d38
parentd1692251fc12e4a6f27f7187e2d6154f00d42ece (diff)
downloadproperties-e92b44754518c11f38df677feb996a5e4cca9f26.tar.gz
properties-e92b44754518c11f38df677feb996a5e4cca9f26.zip
Add rules to the lexer to ignore comments
-rw-r--r--properties.l3
1 files changed, 2 insertions, 1 deletions
diff --git a/properties.l b/properties.l
index 5ffe47b..a2bde9b 100644
--- a/properties.l
+++ b/properties.l
@@ -7,7 +7,8 @@
=|: return DIV;
^[ \t]*[a-zA-Z0-9\.]* yylval.value = strdup(yytext); return KEY;
\n ; /* Ignores empty lines with a single newline */
+^[ \t]*#.* ; /* Ignores comments */
+^[ \t]*/\r?\n ; /* /\r?\n get the end of line, ref: https://stackoverflow.com/a/56104754 */
. yylval.value = strdup(yytext); return VALUE;
-^[ \t]*/\r?\n ; /* /\r?\n get the end of line, ref: https://stackoverflow.com/a/56104754 */
%%