summaryrefslogtreecommitdiffstats
path: root/conf/cf-lex.l
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2011-03-23 12:49:53 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2011-03-23 12:49:53 +0100
commit26d92bb8921ac4e022cdc88bde8fc7bc617f8766 (patch)
tree5e900b466e46e1848b4d2bd98a5894cf6214b08b /conf/cf-lex.l
parent6bcef22580010aec695fb2b559c7b33ee00261b0 (diff)
downloadbird-26d92bb8921ac4e022cdc88bde8fc7bc617f8766.tar
bird-26d92bb8921ac4e022cdc88bde8fc7bc617f8766.zip
A hack to distinguish if..else from else: in case.
The old BIRD grammar needs two lookaheads to distinguish if..else from else: in case, which caused the parser to fail on some combinations of both expressions. This patch replaces two tokens 'else' ':' by one token 'else:' to fix that.
Diffstat (limited to 'conf/cf-lex.l')
-rw-r--r--conf/cf-lex.l5
1 files changed, 5 insertions, 0 deletions
diff --git a/conf/cf-lex.l b/conf/cf-lex.l
index c6e9a0e..828dfd2 100644
--- a/conf/cf-lex.l
+++ b/conf/cf-lex.l
@@ -137,6 +137,11 @@ WHITE [ \t]
return NUM;
}
+else: {
+ /* Hack to distinguish if..else from else: in case */
+ return ELSECOL;
+}
+
({ALPHA}{ALNUM}*|[']({ALNUM}|[-])*[']) {
if(*yytext == '\'') {
yytext[yyleng-1] = 0;