[mapserver-commits] r9813 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Sat Feb 20 13:27:15 EST 2010


Author: sdlime
Date: 2010-02-20 13:27:15 -0500 (Sat, 20 Feb 2010)
New Revision: 9813

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/maplexer.l
Log:
Report parsing errors in INCUDEd files using the line number within the file.

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2010-02-20 18:24:26 UTC (rev 9812)
+++ trunk/mapserver/HISTORY.TXT	2010-02-20 18:27:15 UTC (rev 9813)
@@ -14,6 +14,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Report parsing errors in INCUDEd files using the line number within the file
+
 - Avoid memory error when building SQL bbox (#3324)
 
 - Reproject rectangles as polygons to get datelin wrapping (#3179)

Modified: trunk/mapserver/maplexer.l
===================================================================
--- trunk/mapserver/maplexer.l	2010-02-20 18:24:26 UTC (rev 9812)
+++ trunk/mapserver/maplexer.l	2010-02-20 18:27:15 UTC (rev 9813)
@@ -36,6 +36,7 @@
 
 #define MAX_INCLUDE_DEPTH 5
 YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
+int include_lineno[MAX_INCLUDE_DEPTH];
 int include_stack_ptr = 0;
 char path[MS_MAXPATHLEN];
 %}
@@ -61,7 +62,7 @@
          msyystate=MS_TOKENIZE_DEFAULT;
          msyystring=NULL;
          msyyreturncomments=0;
-         include_stack_ptr=0; 
+         include_stack_ptr=0;
          return(0);
          break;
        case(MS_TOKENIZE_STRING):
@@ -480,7 +481,9 @@
                                                    return(-1);
                                                  }
 
-                                                 include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER;
+                                                 include_stack[include_stack_ptr] = YY_CURRENT_BUFFER; /* save state */
+                                                 include_lineno[include_stack_ptr] = msyylineno;
+                                                 include_stack_ptr++;
 
                                                  msyyin = fopen(msBuildPath(path, msyybasepath, msyytext), "r");
                                                  if(!msyyin) {
@@ -489,6 +492,7 @@
                                                  }
 
                                                  msyy_switch_to_buffer( msyy_create_buffer(msyyin, YY_BUF_SIZE) );
+                                                 msyylineno = 1;
 
                                                  BEGIN(INITIAL);
                                                }
@@ -566,6 +570,7 @@
                                                     fclose(YY_CURRENT_BUFFER->yy_input_file);
                                                     msyy_delete_buffer( YY_CURRENT_BUFFER );
                                                     msyy_switch_to_buffer(include_stack[include_stack_ptr]);
+                                                    msyylineno = include_lineno[include_stack_ptr];
                                                   }
                                                 }
 



More information about the mapserver-commits mailing list