forked from enlightenment/efl
elm_code: Improve string syntax parsing
This commit is contained in:
parent
5851a9d4a8
commit
d5480c3103
|
@ -90,7 +90,7 @@ elm_code_syntax_parse_line(Elm_Code_Syntax *syntax, Elm_Code_Line *line)
|
||||||
{
|
{
|
||||||
unsigned int start = i, end;
|
unsigned int start = i, end;
|
||||||
|
|
||||||
for (i++; content[i] != '"' && i < length; i++) {}
|
for (i++; i < length && (content[i] != '"' || content[i-1] == '\\'); i++) {}
|
||||||
end = i;
|
end = i;
|
||||||
|
|
||||||
elm_code_line_token_add(line, start, end, 1, ELM_CODE_TOKEN_TYPE_STRING);
|
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)
|
||||||
{
|
{
|
||||||
unsigned int start = i, end;
|
unsigned int start = i, end;
|
||||||
|
|
||||||
for (i++; content[i] != '\'' && i < length; i++) {}
|
for (i++; i < length && (content[i] != '\'' || content[i-1] == '\\'); i++) {}
|
||||||
end = i;
|
end = i;
|
||||||
|
|
||||||
elm_code_line_token_add(line, start, end, 1, ELM_CODE_TOKEN_TYPE_STRING);
|
elm_code_line_token_add(line, start, end, 1, ELM_CODE_TOKEN_TYPE_STRING);
|
||||||
|
|
Loading…
Reference in New Issue