[mapserver-commits] r7420 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Sun Mar 2 09:45:12 EST 2008
Author: sdlime
Date: 2008-03-02 09:45:12 -0500 (Sun, 02 Mar 2008)
New Revision: 7420
Modified:
trunk/mapserver/maplexer.l
Log:
Fixed a problem where 2 or more divisions in an expression result in parse errors (bug 2527).
Modified: trunk/mapserver/maplexer.l
===================================================================
--- trunk/mapserver/maplexer.l 2008-03-02 14:41:53 UTC (rev 7419)
+++ trunk/mapserver/maplexer.l 2008-03-02 14:45:12 UTC (rev 7420)
@@ -43,6 +43,7 @@
%s URL_VARIABLE
%s URL_STRING
%s EXPRESSION_STRING
+%s EXPRESSION_STRING_REGEX
%s INCLUDE
%s MSSTR
@@ -108,7 +109,7 @@
break;
}
-<INITIAL,URL_STRING,EXPRESSION_STRING,INCLUDE>[ \t\r]+ ;
+<INITIAL,URL_STRING,EXPRESSION_STRING,EXPRESSION_STRING_REGEX,INCLUDE>[ \t\r]+ ;
<INITIAL>#.* { if (msyyreturncomments) return(MS_COMMENT); }
@@ -122,7 +123,10 @@
<EXPRESSION_STRING>lt|< { return(LT); }
<EXPRESSION_STRING>ge|>= { return(GE); }
<EXPRESSION_STRING>le|<= { return(LE); }
-<EXPRESSION_STRING>=~ { return(RE); }
+<EXPRESSION_STRING>=~ {
+ BEGIN(EXPRESSION_STRING_REGEX);
+ return(RE);
+ }
<EXPRESSION_STRING>in { return(IN); }
<EXPRESSION_STRING>not|! { return(NOT); }
@@ -419,10 +423,11 @@
return(MS_IREGEX);
}
-<EXPRESSION_STRING>\/[^\/]*\/i {
+<EXPRESSION_STRING_REGEX>\/[^\/]*\/i {
msyytext++;
msyytext[strlen(msyytext)-2] = '\0';
msyylval.strval = strdup(msyytext);
+ BEGIN(EXPRESSION_STRING);
return(IREGEX);
}
@@ -432,10 +437,11 @@
return(MS_REGEX);
}
-<EXPRESSION_STRING>\/[^\/]*\/ {
+<EXPRESSION_STRING_REGEX>\/[^\/]*\/ {
msyytext++;
msyytext[strlen(msyytext)-1] = '\0';
msyylval.strval = strdup(msyytext);
+ BEGIN(EXPRESSION_STRING);
return(REGEX);
}
More information about the mapserver-commits
mailing list