Ability to quote single quotes and double quotes #3706

Closed
mapserver-bot opened this Issue Apr 4, 2012 · 9 comments

1 participant

@mapserver-bot

Reporter: aboudreault
Date: 2011/03/01 - 15:29
Trac URL: http://trac.osgeo.org/mapserver/ticket/3706
At the moment, there is no way to use the ' or " characters in a mapfile string. This ticket is to add that ability to our mapfile parser as we did for MapServer expression.

@mapserver-bot

Author: aboudreault
Date: 2011/03/02 - 15:42
Steve, I did a patch for that ticket... but I'm not very familiar with flex/bison. The parser works... but I'm getting a few bad behavior. Do you think you could check my lexer code and see how we could fix it?

@mapserver-bot

Author: aboudreault
Date: 2011/03/02 - 20:28
Here's my patch. The logic seems to work... based on my printf in the mapfile.c:getString() method but something seems to be incorrect. if you try a simple getmap of gmap75.map, you should see the error. Let me know what you think.

@mapserver-bot

Author: sdlime
Date: 2011/03/03 - 06:23
Cool, will take a look...

Steve

@mapserver-bot

Author: aboudreault
Date: 2011/03/17 - 17:17
Fixed and committed in 187bad5 (r11194). We are now able to escape single and double quotes inside a string and a logical expression. Here's a few valid examples:

NAME "ROAD'" # single quote doesn't need to be quoted inside double quotes
NAME 'ROAD"' # double quote doesn't need to be quoted inside single quotes
NAME 'ROAD\"' # but they can....

NAME "RO\"AD" # double quote inside a a double quote delimited string
NAME 'RO\AD' # single quote inside a a single quote delimited string

FILTER 'aitkin'i # normal insensitive string
FILTER ('[CTY_NAME]' = 'Ita\'sca') # logical expression that contains a single quote
@mapserver-bot

Author: aboudreault
Date: 2011/03/17 - 18:22
oups, the line

NAME 'RO\AD' # single quote inside a a single quote delimited string

should be

NAME 'RO\'AD' # single quote inside a a single quote delimited string

I had forgotten the quote.

@mapserver-bot

Author: dmorissette
Date: 2011/03/17 - 19:53
Reopening: we probably need to document this somewhere?

@mapserver-bot

Author: havatv
Date: 2011/06/30 - 13:32
I intend to include this in the expressions document [http://www.mapserver.org/mapfile/expressions.html]. I hope that is OK. Where else should it be mentioned?

@mapserver-bot

Author: havatv
Date: 2011/06/30 - 13:59
I have now updated the expressions document http://www.mapserver.org/mapfile/expressions.html, and close this ticket.
Please reopen if more needs to be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment