]> git.ipfire.org Git - pakfire.git/commitdiff
libpakfire: parser: Scan for if and ==
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 14 Mar 2019 05:43:54 +0000 (05:43 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 14 Mar 2019 05:43:54 +0000 (05:43 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/parser/grammar.y
src/libpakfire/parser/scanner.l

index 77fef525970045398ba1c35e9be075bd03b7bf6e..8359e370f1925b87feb57bc4c9393f74d3ba2c31 100644 (file)
@@ -62,6 +62,8 @@ char* current_block = NULL;
 %token ASSIGN
 %token DEFINE
 %token END
+%token <string>                                        EQUALS
+%token IF
 %token NEWLINE
 %token TAB
 %token WHITESPACE
index a41a88338c8e6d42306d5ef68680b260f152e5b2..14ea6f846f1bf0c5779472bc5b7d618ff252cd43 100644 (file)
@@ -44,9 +44,11 @@ word                 ({digit}|{letter}|{special})+
 {whitespace}   { return WHITESPACE; }
 \n                             { num_lines++; return NEWLINE; }
 
+"=="                   { return EQUALS; }
 "="                            { return ASSIGN; }
 "+="                   { return APPEND; }
 
+"if"                   { return IF; }
 "define"               { return DEFINE; }
 "def"                  { return DEFINE; }
 "end"                  { return END; }