summaryrefslogtreecommitdiff
path: root/properties.l
blob: b1b86178dde0cb1581d9a0d824fa5612a3a6c127 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
%{
#include "properties-parser.h"
#include "utils/string.h"
%}

%%

=|:                           yylval.value = strdup(yytext); return DIV;
^[ \t]*[a-zA-Z0-9\.]*[ \t]*   yylval.value = strdup(trim(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;

%%