diff options
| author | Greg Ercolano <erco@seriss.com> | 2020-09-20 16:05:16 -0700 |
|---|---|---|
| committer | Greg Ercolano <erco@seriss.com> | 2020-11-01 12:16:23 -0800 |
| commit | d66e146a89cd92307cb404bb203a9ce46f890375 (patch) | |
| tree | e1d71466fcb75f772133e59e990db94f3e05fe45 /fluid/StyleParse.cxx | |
| parent | 4d503899a3dec9df8380b3981f1a7259e9d6cb8c (diff) | |
Handle single quotes
Diffstat (limited to 'fluid/StyleParse.cxx')
| -rw-r--r-- | fluid/StyleParse.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fluid/StyleParse.cxx b/fluid/StyleParse.cxx index 043f2c837..abbb33fcf 100644 --- a/fluid/StyleParse.cxx +++ b/fluid/StyleParse.cxx @@ -258,18 +258,19 @@ int StyleParse::parse_keyword() { return parse_over_key(key, style); } -// Style parse a quoted string. +// Style parse a quoted string, either "" or ''. // Returns 0 if hit end of buffer, 1 otherwise. // -int StyleParse::parse_quoted_string() { - style = 'D'; // start string style +int StyleParse::parse_quoted_string(char quote_char, // e.g. '"' or '\'' + char in_style) { // style for quoted text + style = in_style; // start string style if ( !parse_over_char() ) return 0; // parse over opening quote // Parse until closing quote reached char c; while ( len > 0 ) { c = tbuff[0]; - if ( c == '"' ) { // Closing quote? Parse and done + if ( c == quote_char ) { // Closing quote? Parse and done if ( !parse_over_char() ) return 0; // close quote break; } else if ( c == '\\' ) { // Escape sequence? Parse over, continue |
