| 2104 | } |
| 2105 | |
| 2106 | int loadExpressionString(expressionObj *exp, char *value) |
| 2107 | { |
| 2108 | msyystate = MS_TOKENIZE_STRING; msyystring = value; |
| 2109 | msyylex(); /* sets things up but processes no tokens */ |
| 2110 | |
| 2111 | freeExpression(exp); /* we're totally replacing the old expression so free (which re-inits) to start over */ |
| 2112 | |
| 2113 | msyystring_icase = MS_TRUE; |
| 2114 | if((exp->type = getSymbol(4, MS_EXPRESSION,MS_REGEX,MS_IREGEX,MS_ISTRING)) != -1) { |
| 2115 | exp->string = msStrdup(msyystring_buffer); |
| 2116 | |
| 2117 | if(exp->type == MS_ISTRING) { |
| 2118 | exp->type = MS_STRING; |
| 2119 | exp->flags = exp->flags | MS_EXP_INSENSITIVE; |
| 2120 | } else if(exp->type == MS_IREGEX) { |
| 2121 | exp->type = MS_REGEX; |
| 2122 | exp->flags = exp->flags | MS_EXP_INSENSITIVE; |
| 2123 | } |
| 2124 | } else { |
| 2125 | msResetErrorList(); /* failure above is not really an error since we'll consider anything not matching (like an unquoted number) as a STRING) */ |
| 2126 | exp->type = MS_STRING; |
| 2127 | if((strlen(value) - strlen(msyystring_buffer)) == 2) |
| 2128 | exp->string = msStrdup(msyystring_buffer); /* value was quoted */ |
| 2129 | else |
| 2130 | exp->string = msStrdup(value); /* use the whole value */ |
| 2131 | } |
| 2132 | |
| 2133 | return(0); |
| 2134 | } |
| 2135 | |
| 2136 | /* msGetExpressionString() |
| 2137 | * |
no test coverage detected