summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-01-21 00:17:20 +0000
committerAndy Williams <andy@andywilliams.me>2017-01-21 00:17:20 +0000
commitd5480c31031c147ebf7c3c14981666aa6f1857fd (patch)
tree1b5f7a8a43073e63d9a02dd464f3ffbd3773f03d
parent5851a9d4a82b1fb5638d46f510fe9e8b6c7bdbb4 (diff)
elm_code: Improve string syntax parsing
-rw-r--r--src/lib/elementary/elm_code_syntax.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/elementary/elm_code_syntax.c b/src/lib/elementary/elm_code_syntax.c
index 3a35f2e632..96becb9236 100644
--- a/src/lib/elementary/elm_code_syntax.c
+++ b/src/lib/elementary/elm_code_syntax.c
@@ -90,7 +90,7 @@ elm_code_syntax_parse_line(Elm_Code_Syntax *syntax, Elm_Code_Line *line)
90 { 90 {
91 unsigned int start = i, end; 91 unsigned int start = i, end;
92 92
93 for (i++; content[i] != '"' && i < length; i++) {} 93 for (i++; i < length && (content[i] != '"' || content[i-1] == '\\'); i++) {}
94 end = i; 94 end = i;
95 95
96 elm_code_line_token_add(line, start, end, 1, ELM_CODE_TOKEN_TYPE_STRING); 96 elm_code_line_token_add(line, start, end, 1, ELM_CODE_TOKEN_TYPE_STRING);
@@ -100,7 +100,7 @@ elm_code_syntax_parse_line(Elm_Code_Syntax *syntax, Elm_Code_Line *line)
100 { 100 {
101 unsigned int start = i, end; 101 unsigned int start = i, end;
102 102
103 for (i++; content[i] != '\'' && i < length; i++) {} 103 for (i++; i < length && (content[i] != '\'' || content[i-1] == '\\'); i++) {}
104 end = i; 104 end = i;
105 105
106 elm_code_line_token_add(line, start, end, 1, ELM_CODE_TOKEN_TYPE_STRING); 106 elm_code_line_token_add(line, start, end, 1, ELM_CODE_TOKEN_TYPE_STRING);