summaryrefslogtreecommitdiffstats
path: root/lib/command_lex.l
diff options
context:
space:
mode:
authorDaniel Walton <dwalton@cumulusnetworks.com>2017-09-14 20:07:30 +0200
committerDaniel Walton <dwalton@cumulusnetworks.com>2017-09-14 20:07:30 +0200
commitd114b977e90d09fdfe228fa7feee5a1aadec8903 (patch)
tree61a7795b833ec7a99db050c84d3dd0d533532fce /lib/command_lex.l
parentMerge pull request #1178 from donaldsharp/pim_obfuscation (diff)
downloadfrr-d114b977e90d09fdfe228fa7feee5a1aadec8903.tar.xz
frr-d114b977e90d09fdfe228fa7feee5a1aadec8903.zip
*: support keywords that begin with uppercase letter
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> VARIABLE tokens must be all uppercase, this allows us to support WORD tokens that begin with an uppercase letter. The "Null0" keyword is an example of where this is needed. The only VARIABLE we had that wasn't already all uppercase was ASN:nn_or_IP-address:nn
Diffstat (limited to 'lib/command_lex.l')
-rw-r--r--lib/command_lex.l6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/command_lex.l b/lib/command_lex.l
index 59d0d840a..436f3a241 100644
--- a/lib/command_lex.l
+++ b/lib/command_lex.l
@@ -35,14 +35,14 @@
} } while(0)
%}
-WORD (\-|\+)?[a-z0-9\*][-+_a-zA-Z0-9\*]*
IPV4 A\.B\.C\.D
IPV4_PREFIX A\.B\.C\.D\/M
IPV6 X:X::X:X
IPV6_PREFIX X:X::X:X\/M
MAC M:A:C
MAC_PREFIX M:A:C\/M
-VARIABLE [A-Z][-_a-zA-Z:0-9]+
+VARIABLE [A-Z][-_A-Z:0-9]+
+WORD (\-|\+)?[a-zA-Z0-9\*][-+_a-zA-Z0-9\*]*
NUMBER (\-|\+)?[0-9]{1,20}
RANGE \({NUMBER}[ ]?\-[ ]?{NUMBER}\)
@@ -64,7 +64,6 @@ RANGE \({NUMBER}[ ]?\-[ ]?{NUMBER}\)
%}
[ \t]+ LOC_STEP /* ignore whitespace */;
-{WORD} {yylval->string = XSTRDUP(MTYPE_LEX, yytext); return WORD;}
{IPV4} {yylval->string = XSTRDUP(MTYPE_LEX, yytext); return IPV4;}
{IPV4_PREFIX} {yylval->string = XSTRDUP(MTYPE_LEX, yytext); return IPV4_PREFIX;}
{IPV6} {yylval->string = XSTRDUP(MTYPE_LEX, yytext); return IPV6;}
@@ -72,6 +71,7 @@ RANGE \({NUMBER}[ ]?\-[ ]?{NUMBER}\)
{MAC} {yylval->string = XSTRDUP(MTYPE_LEX, yytext); return MAC;}
{MAC_PREFIX} {yylval->string = XSTRDUP(MTYPE_LEX, yytext); return MAC_PREFIX;}
{VARIABLE} {yylval->string = XSTRDUP(MTYPE_LEX, yytext); return VARIABLE;}
+{WORD} {yylval->string = XSTRDUP(MTYPE_LEX, yytext); return WORD;}
{RANGE} {yylval->string = XSTRDUP(MTYPE_LEX, yytext); return RANGE;}
. {return yytext[0];}
%%