-
Notifications
You must be signed in to change notification settings - Fork 868
Syntax/Pascal: Support multiline strings #2731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Delphi introduced multiline strings in version 12. They start with ''' and end with '''.
The string '''' was not interpreted as a single quotation mark but instead as the start of a multiline string.
Inside a multiline string there is no other syntax highlighting and a single quotation mark (') is valid and does not end the string. The multiline string only ends if a corresponding end (''') is found.
Thank you for the correction. However, according to this blog, there are the following rules:
The current implementation does not seem to follow these rules, and the following is also considered to be multiline strings.
|
The start of a multi-line string is three single quotation marks (''') and then a newline (however spaces and tabs are ok). So check if that is the case. Otherwise ``Test := '''a';`` would be treated as the start of a multi-line string instead of a single quotation mark and an a.
@sdottaka I changed the code to detect text following the start of the multi-line string. This is then not exactly what Delphi renders, but since this would be a syntax error, I think it's fine. |
There may not be any character in front of the end of the multi-line string. This ensures, that the multi-line coloring is not disrupted with single quotation marks.
Thank you for the fix. I've merged this PR. |
Delphi introduced multiline strings in version 12. They start with
'''
and end with ``'''```.Supersedes #2720.
Before:

After:

@sdottaka is there a better constant that
COOKIE_BLOCK_STYLE
to use?