On Mon, Aug 20, 2018 at 1:18 PM, Bram Moolenaar <[email protected]> wrote:
>
> Tony Mechelynck wrote:
>> [...]
>> Fixed-form COBOL (the only kind I knew), where comments had to be on
>> their own lines (with an asterisk in column 7 IIRC), and continuation
>> lines had a dash in the otherwise unused column 7, had strict rules
>> about how to represent quoted strings (which could be up to 120
>> characters long) on punched cards where the useful part of unlabeled
>> lines was 61 characters including the starting quote (from column 12
>> to column 72 inclusive) but these are not germane to Vim and I do not
>> propose to introduce anything similar into Vim script language.
>
> Well, the special character sequence to put in front of a comment in
> between continuation lines is something like that.
>
Hm. This would be hard to decide, because inside a double-quoted
string about anything can be used and becomes part of the string, with
the proviso that a backslash can be used to escape certain special
characters. Repeating the opening quote COBOL-like immediately after
the continuation backslash is of course excluded, as it would break
compatibility. Maybe we need some new syntax for comments which end
before the end of the line, but how to define that without changing
the meaning of some already useful syntax construct, especially inside
a double-quoted string? Maybe \c (which at the moment means nothing
AFAIK) and end the comment with another \c (but \\c would mean, as it
already does, "backslash followed by c"). There might be a problem
with Windows pathnames. Then maybe start with "\c and end with \c. No,
that would clash with existing end-of-line comments. Well, then \c but
precede it with a space if it would otherwise be interpreted as part
of a pathname (since on Windows, a top-level path is not indicated by
a starting backslash but by a drive letter followed by a colon).
Inside double-quoted strings, backslashes are "special" anyway and I
would (even with no change to the existing code) strongly recommend
_not_ to use single backslashes to represent a Windows path inside a
double-quoted string: so
if has('win32' || has('win64'))
let filepathname = "%USERPROFILE%\\this\\and\\that\\filename.ext"
endif
or the same with _single_ quotes and single backslashes, but not
double quotes and single backslashes (other than when intentionally
using them for their "special" meanings as under ":help expr-quote"),
as this would already produce unexpected results if the character
following the backslash is any of X x U u b e f n r t
Best regards,
Tony.
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.