[mapserver-dev] Mapfile syntax permissiveness

Christopher Schmidt crschmidt at metacarta.com
Sat Dec 27 12:53:46 EST 2008

On Sat, Dec 27, 2008 at 09:05:46AM -0600, Howard Butler wrote:
> I was working on implementing a Pygments lexer so we could have  
> mapfile styling for the new website (see the results at 
> http://mapserver.osgeo.org/ogc/mapcontext.html ) and one thing that caused 
>  me trouble (still not right in my lexer,  anyway) is that we allow both:
> NAME mymapname
> and
> NAME "mymapname"
> Why do some keywords like NAME and DATA allow both the quoted and  
> unquoted form?  Was there a historical reason for this?  Is it just  
> because flex supported it?  In my mind, unquoted implies a symbol or a  
> reserved name, not user data.  Would we ever revert to requiring every  
> piece of user data to be quoted?  

I don't see a reason for that; if both work, why make the mapfile *more*

That said, it seems to me that a mapfile pygments parser can only
support the more 'restrictive' form properly, and just make sure all the
documentation examples match that...

> Would there be benefits to this in  
> contrast to the pain it would cause (maybe we have a 'strict' and  
> 'lax' mapfile parser or something)?

I can't think of any...

Christopher Schmidt

More information about the mapserver-dev mailing list