Skip to content

Commit

Permalink
runtime(vim): Update syntax file
Browse files Browse the repository at this point in the history
Match multiline (continued) comments and strings.
  • Loading branch information
dkearns committed Mar 21, 2024
1 parent 9f26e5a commit a58db2a
Show file tree
Hide file tree
Showing 16 changed files with 251 additions and 45 deletions.
28 changes: 19 additions & 9 deletions runtime/syntax/generator/vim.vim.base
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBan

" Operators: {{{2
" =========
syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimType,vimRegister,@vimContinue,vim9Comment,vimVar
syn match vimOper "||\|&&\|[-+*/%.!]" skipwhite nextgroup=vimString,vimSpecFile
syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile
syn match vimOper "\(\<is\|\<isnot\)[?#]\{0,2}\>" skipwhite nextgroup=vimString,vimSpecFile
syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimContinueString,vimType,vimRegister,@vimContinue,vim9Comment,vimVar
syn match vimOper "||\|&&\|[-+*/%.!]" skipwhite nextgroup=vimString,vimContinueString,vimSpecFile
syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimContinueString,vimSpecFile
syn match vimOper "\(\<is\|\<isnot\)[?#]\{0,2}\>" skipwhite nextgroup=vimString,vimContinueString,vimSpecFile
syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=vimoperStar,@vimOperGroup
syn region vimOperParen matchgroup=vimSep start="#\={" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar
if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
Expand Down Expand Up @@ -358,6 +358,12 @@ syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start
syn match vimStringInterpolationBrace contained "{{"
syn match vimStringInterpolationBrace contained "}}"

syn region vimContinueString contained start=+$'+ end=+'+ skip=+\\\\\|\\'\|''+ contains=@vimContinue,vimStringInterpolationBrace,vimStringInterpolationExpr
syn region vimContinueString contained start=+$"+ skip=/\\\\\|\\"\|\s*"\\ / end=+"+ contains=@vimContinue,@vimStringGroup,vimStringInterpolationBrace,vimStringInterpolationExpr
syn region vimContinueString contained start=/'/ skip=/''/ end=/'/ contains=@vimContinue
syn region vimContinueString contained start=/"/ skip=/\\\\\|\\"\|\s*"\\ / end=/"/ contains=@vimContinue,@vimStringGroup
hi def link vimContinueString vimString

" Substitutions: {{{2
" =============
syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation
Expand Down Expand Up @@ -730,15 +736,19 @@ syn match vimCtrlChar "[- -]"

" Beginners - Patterns that involve ^ {{{2
" =========
syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle,vimComment
syn match vimLineComment +^[ \t:]*"\("[^"]*"\|[^"]\)*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle
syn match vim9LineComment +^[ \t:]\+#.*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle
" syn region vimLineComment start=+^[ \t:]*".*$+ skip="\n\s*\\" end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle,vimComment
" syn region vimLineComment start=+^[ \t:]*"\("[^"]*"\|[^"]\)*$+ skip="\n\s*\\" end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle
" syn region vim9LineComment start=+^[ \t:]\+#.*$+ skip="\n\s*\\" end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle
syn region vimLineComment start=+^[ \t:]*"\%(\\ \)\@!.*$+ skip=+\n\s*\\\|\n\s*"\\ + end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle,vimComment,@vimContinue
syn region vimLineComment start=+^[ \t:]*"\%(\\ \)\@!\("[^"]*"\|[^"]\)*$+ skip=+\n\s*\\\|\n\s*"\\ + end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle,@vimContinue
syn region vim9LineComment start=+^[ \t:]\+#\%(\\ \)\@!.*$+ skip=+\n\s*\\\|\n\s*"\\ + end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle,@vimContinue
syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup
" Note: Look-behind to work around nextgroup skipnl consuming leading whitespace and preventing a match

syn match vimContinue "^\s*\zs\\"
syn match vimContinueComment '^\s*\zs["#]\\ .*' contained
syn cluster vimContinue contains=vimContinue,vimContinueComment
syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue
" TODO: ??? This is from v7.0 or earlier
" syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue
syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained

" Searches And Globals: {{{2
Expand Down
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/vim_comments_00.dump
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
>"+0#0000e05#ffffff0| |C|o|m@1|e|n|t|s| +0#0000000&@64
@75
|"+0#0000e05&| |l|i|n|e| |c|o|m@1|e|n|t| +0#0000000&@60
|f|o@1|(+0#e000e06&|)| +0#0000000&|"+0#0000e05&| |t|a|i|l| |c|o|m@1|e|n|t| +0#0000000&@54
@75
|:|F|o@1| @70
@6|"+0#0000e05&|\| |l|i|n|e| |c|o|n|t|i|n|u|a|t|i|o|n| |c|o|m@1|e|n|t| +0#0000000&@40
@6|\+0#e000e06&| +0#0000000&|a|r|g|1| @62
@6|"+0#0000e05&|\| |l|i|n|e| |c|o|n|t|i|n|u|a|t|i|o|n| |c|o|m@1|e|n|t| +0#0000000&@40
@6|\+0#e000e06&| +0#0000000&|a|r|g|2| @62
@75
|"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65
| +0#0000e05&@1|\+0#e000e06&| +0#0000e05&|c|o|n|t|i|n|u|i|n|g| |c|o|m@1|e|n|t| +0#0000000&@52
| +0#0000e05&@1|\+0#e000e06&| +0#0000e05&|c|o|n|t|i|n|u|i|n|g| |c|o|m@1|e|n|t| +0#0000000&@52
@75
|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|T|O|P|"| +0#0000000&@64
@75
|"+0#0000e05&| |:|F|o@1| +0#0000000&@68
| +0#0000e05&@5|\+0#e000e06&| +0#0000e05&|a|r|g| +0#0000000&@63
@57|1|,|1| @10|T|o|p|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/vim_comments_01.dump
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
| +0#0000e05#ffffff0@1|\+0#e000e06&| +0#0000e05&|c|o|n|t|i|n|u|i|n|g| |c|o|m@1|e|n|t| +0#0000000&@52
@75
|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|T|O|P|"| +0#0000000&@64
@75
|"+0#0000e05&| |:|F|o@1| +0#0000000&@68
| +0#0000e05&@5>\+0#e000e06&| +0#0000e05&|a|r|g| +0#0000000&@63
| +0#0000e05&@5|"|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#0000e05&@5|\+0#e000e06&| +0#0000e05&|a|r|g| +0#0000000&@63
@75
|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|T|O|P|"| +0#0000000&@64
|~+0#4040ff13&| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
| +0#0000000&@56|1|9|,|7| @9|B|o|t|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/vim_comments_99.dump
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
| +0&#ffffff0@74
|:|F|o@1| @70
@6|"+0#0000e05&|\| |l|i|n|e| |c|o|n|t|i|n|u|a|t|i|o|n| |c|o|m@1|e|n|t| +0#0000000&@40
@6|\+0#e000e06&| +0#0000000&|a|r|g|1| @62
@6|"+0#0000e05&|\| |l|i|n|e| |c|o|n|t|i|n|u|a|t|i|o|n| |c|o|m@1|e|n|t| +0#0000000&@40
@6|\+0#e000e06&| +0#0000000&|a|r|g|2| @62
@75
|"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65
| +0#0000e05&@1|\+0#e000e06&| +0#0000e05&|c|o|n|t|i|n|u|i|n|g| |c|o|m@1|e|n|t| +0#0000000&@52
| +0#0000e05&@1|\+0#e000e06&| +0#0000e05&|c|o|n|t|i|n|u|i|n|g| |c|o|m@1|e|n|t| +0#0000000&@52
@75
|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|T|O|P|"| +0#0000000&@64
@75
|"+0#0000e05&| |:|F|o@1| +0#0000000&@68
| +0#0000e05&@5|\+0#e000e06&| +0#0000e05&|a|r|g| +0#0000000&@63
| +0#0000e05&@5|"|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#0000e05&@5|\+0#e000e06&| +0#0000e05&|a|r|g| +0#0000000&@63
@75
>e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|T|O|P|"| +0#0000000&@64
@57|2|3|,|1| @9|B|o|t|
2 changes: 1 addition & 1 deletion runtime/syntax/testdir/dumps/vim_expr_01.dump
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|'|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\|t|{+0#e000e06&@1| +0#e000002&|{+0#e000e06&| +0#0000000&|$+0#e000002&|'|n|e|s|t|e|d|:| |{+0#e000e06&@1| +0#e000002&|{+0#e000e06&|1+0#e000002&| +0#0000000&|++0#af5f00255&| +0#0000000&|2+0#e000002&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|'+0#e000002&| +0#0000000&@6
|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\+0#e000e06&|t|{@1| +0#e000002&|{+0#e000e06&| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|{|"+0#e000002&|f|o@1|"|:+0#0000000&| |"+0#e000002&|b|a|r|"|}+0#e000e06&|)| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&@8
|e+0#af5f00255&|c|h|o| +0#0000000&|$+0#e000002&|"|H|i|g|h|l|i|g|h|t| |i|n|t|e|r|p|o|l|a|t|i|o|n|:|\+0#e000e06&|t|{@1| +0#e000002&|{+0#e000e06&| +0#0000000&|$+0#e000002&|"|n|e|s|t|e|d|:| |{+0#e000e06&@1| +0#e000002&|{+0#e000e06&|1+0#e000002&| +0#0000000&|++0#af5f00255&| +0#0000000&|2+0#e000002&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&|}+0#e000e06&| +0#e000002&|}+0#e000e06&@1|"+0#e000002&| +0#0000000&@6
@57|1|9|,|1| @9|2|4|%|
@57|1|9|,|1| @9|1|3|%|
2 changes: 1 addition & 1 deletion runtime/syntax/testdir/dumps/vim_expr_02.dump
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|O|3|7@1| +0#0000000&@63
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|3|7@1| +0#0000000&@64
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|o|3|7@1| +0#0000000&@63
@57|3|7|,|1| @9|5|9|%|
@57|3|7|,|1| @9|3|2|%|
2 changes: 1 addition & 1 deletion runtime/syntax/testdir/dumps/vim_expr_03.dump
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
|-+0#af5f00255&|3+0#e000002&|.|1|4|1|6|e|+|8@1| +0#0000000&@63
@75
|"+0#0000e05&| |B|l|o|b| +0#0000000&@68
@57|5@1|,|1| @9|9|4|%|
@57|5@1|,|1| @9|5|1|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/vim_expr_04.dump
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
|"+0#0000e05#ffffff0| |B|l|o|b| +0#0000000&@68
|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|E|D|0|1|5|D|A|F| +0#0000000&@55
|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|.|E|D|0|1|.|5|D|A|F| +0#0000000&@53
|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|.|0@1|.|E|D|.|0|1|.|5|D|.|A|F| +0#0000000&@50
@75
>"+0#0000e05&| |M|u|l|t|i|l|i|n|e| |(|c|o|n|t|i|n|u|e|d|)| |s|t|r|i|n|g|s| +0#0000000&@43
@75
|l+0#af5f00255&|e|t| +0#0000000&|s+0#00e0e07&| +0#0000000&|=+0#af5f00255&| +0#0000000&|"+0#e000002&| +0#0000000&@65
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5|\+0#e000e06&| +0#e000002&|l|i|n|e| |1| +0#0000000&@60
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5|\+0#e000e06&| +0#e000002&|l|i|n|e| |2| +0#0000000&@60
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5|\+0#e000e06&|"+0#e000002&| +0#0000000&|"+0#0000e05&| |t|a|i|l| |c|o|m@1|e|n|t| +0#0000000&@51
@75
|l+0#af5f00255&|e|t| +0#0000000&|s+0#00e0e07&| +0#0000000&|=+0#af5f00255&| +0#0000000&|"+0#e000002&| +0#0000000&@65
| +0#e000002&@5|\+0#e000e06&| +0#e000002&|l|i|n|e| |1| +0#0000000&@60
| +0#e000002&@5|"+0#0000e05&|\| |e|s|c|a|p|e| |s|e|q|u|e|n|c|e| +0#0000000&@50
| +0#e000002&@5|\+0#e000e06&@1|"| +0#e000002&|l|i|n|e| |2| +0#0000000&@58
@57|7|3|,|1| @9|7|0|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/vim_expr_05.dump
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
| +0#e000002#ffffff0@5|\+0#e000e06&@1|"| +0#e000002&|l|i|n|e| |2| +0#0000000&@58
| +0#e000002&@5|\+0#e000e06&|"+0#e000002&| +0#0000000&|"+0#0000e05&| |t|a|i|l| |c|o|m@1|e|n|t| +0#0000000&@51
@75
|l+0#af5f00255&|e|t| +0#0000000&|s+0#00e0e07&| +0#0000000&|=+0#af5f00255&| +0#0000000&|'+0#e000002&| +0#0000000&@65
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5>\+0#e000e06&| +0#e000002&|l|i|n|e| |1| +0#0000000&@60
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5|\+0#e000e06&| +0#e000002&|l|i|n|e| |2| +0#0000000&@60
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5|\+0#e000e06&|'+0#e000002&| +0#0000000&|"+0#0000e05&| |t|a|i|l| |c|o|m@1|e|n|t| +0#0000000&@51
@75
|l+0#af5f00255&|e|t| +0#0000000&|s+0#00e0e07&| +0#0000000&|=+0#af5f00255&| +0#0000000&|$+0#e000002&|"| +0#0000000&@64
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5|\+0#e000e06&| +0#e000002&|l|i|n|e| |1| +0#0000000&@60
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5|\+0#e000e06&| +0#e000002&|l|i|n|e| |2| +0#0000000&@60
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5|\+0#e000e06&|"+0#e000002&| +0#0000000&|"+0#0000e05&| |t|a|i|l| |c|o|m@1|e|n|t| +0#0000000&@51
@75
@57|9|1|,|7| @9|8|9|%|
20 changes: 20 additions & 0 deletions runtime/syntax/testdir/dumps/vim_expr_06.dump
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
| +0&#ffffff0@74
|l+0#af5f00255&|e|t| +0#0000000&|s+0#00e0e07&| +0#0000000&|=+0#af5f00255&| +0#0000000&|$+0#e000002&|'| +0#0000000&@64
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5|\+0#e000e06&| +0#e000002&|l|i|n|e| |1| +0#0000000&@60
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5>\+0#e000e06&| +0#e000002&|l|i|n|e| |2| +0#0000000&@60
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5|\+0#e000e06&|'+0#e000002&| +0#0000000&|"+0#0000e05&| |t|a|i|l| |c|o|m@1|e|n|t| +0#0000000&@51
@75
|"+0#0000e05&| |l|i|n|e| |c|o|m@1|e|n|t| +0#0000000&@60
|f|o@1|(+0#e000e06&|)| +0#0000000&|"+0#0000e05&| |t|a|i|l| |c|o|m@1|e|n|t| +0#0000000&@54
|~+0#4040ff13&| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
| +0#0000000&@56|1|0|9|,|7| @8|B|o|t|
36 changes: 18 additions & 18 deletions runtime/syntax/testdir/dumps/vim_expr_99.dump
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
|"+0#0000e05#ffffff0| |B|i|n|a|r|y| +0#0000000&@66
|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|b|1@7| +0#0000000&@58
|e+0#af5f00255&|c|h|o| +0#0000000&@1|0+0#e000002&|B|1@7| +0#0000000&@58
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|b|1@7| +0#0000000&@58
|e+0#af5f00255&|c|h|o| +0#0000000&|-+0#af5f00255&|0+0#e000002&|B|1@7| +0#0000000&@58
| +0&#ffffff0@74
|l+0#af5f00255&|e|t| +0#0000000&|s+0#00e0e07&| +0#0000000&|=+0#af5f00255&| +0#0000000&|$+0#e000002&|"| +0#0000000&@64
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5|\+0#e000e06&| +0#e000002&|l|i|n|e| |1| +0#0000000&@60
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5|\+0#e000e06&| +0#e000002&|l|i|n|e| |2| +0#0000000&@60
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5|\+0#e000e06&|"+0#e000002&| +0#0000000&|"+0#0000e05&| |t|a|i|l| |c|o|m@1|e|n|t| +0#0000000&@51
@75
|"+0#0000e05&| |F|l|o|a|t| +0#0000000&@67
|1+0#e000002&|2|3|.|4|5|6| +0#0000000&@67
|++0#af5f00255&|0+0#e000002&|.|0@2|1| +0#0000000&@67
|5+0#e000002&@1|.|0| +0#0000000&@70
|-+0#af5f00255&|0+0#e000002&|.|1|2|3| +0#0000000&@68
|1+0#e000002&|.|2|3|4|e|0|3| +0#0000000&@66
|1+0#e000002&|.|0|E|-|6| +0#0000000&@68
|-+0#af5f00255&|3+0#e000002&|.|1|4|1|6|e|+|8@1| +0#0000000&@63
|l+0#af5f00255&|e|t| +0#0000000&|s+0#00e0e07&| +0#0000000&|=+0#af5f00255&| +0#0000000&|$+0#e000002&|'| +0#0000000&@64
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5|\+0#e000e06&| +0#e000002&|l|i|n|e| |1| +0#0000000&@60
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5|\+0#e000e06&| +0#e000002&|l|i|n|e| |2| +0#0000000&@60
| +0#e000002&@5|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
| +0#e000002&@5|\+0#e000e06&|'+0#e000002&| +0#0000000&|"+0#0000e05&| |t|a|i|l| |c|o|m@1|e|n|t| +0#0000000&@51
@75
|"+0#0000e05&| |B|l|o|b| +0#0000000&@68
|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|E|D|0|1|5|D|A|F| +0#0000000&@55
|e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|0@1|.|E|D|0|1|.|5|D|A|F| +0#0000000&@53
>e+0#af5f00255&|c|h|o| +0#0000000&|0+0#e000002&|z|F@1|.|0@1|.|E|D|.|0|1|.|5|D|.|A|F| +0#0000000&@50
@57|7|1|,|1| @9|B|o|t|
|"+0#0000e05&| |l|i|n|e| |c|o|m@1|e|n|t| +0#0000000&@60
>f|o@1|(+0#e000e06&|)| +0#0000000&|"+0#0000e05&| |t|a|i|l| |c|o|m@1|e|n|t| +0#0000000&@54
@57|1@1|4|,|1| @8|B|o|t|
6 changes: 3 additions & 3 deletions runtime/syntax/testdir/dumps/vim_line_continuation_02.dump
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
@6|\+0#e000e06&|}| +0#0000000&@66
@75
|l+0#af5f00255&|e|t| +0#0000000&|a+0#00e0e07&|r@1|a|y| +0#0000000&|=+0#af5f00255&| +0#0000000&|[| @61
| +0#0000e05&@5|"|\| |e|l|e|m|e|n|t| |1| +0#0000000&@56
@6|"+0#0000e05&|\| |e|l|e|m|e|n|t| |1| +0#0000000&@56
@6|\+0#e000e06&| +0#0000000&|1+0#e000002&|,+0#0000000&| @64
| +0#0000e05&@5|"|\| |e|l|e|m|e|n|t| |2| +0#0000000&@56
@6|"+0#0000e05&|\| |e|l|e|m|e|n|t| |2| +0#0000000&@56
@6|\+0#e000e06&| +0#0000000&|2+0#e000002&|,+0#0000000&| @64
| +0#0000e05&@5|"|\| |e|l|e|m|e|n|t| |3| +0#0000000&@56
@6|"+0#0000e05&|\| |e|l|e|m|e|n|t| |3| +0#0000000&@56
@6|\+0#e000e06&| +0#0000000&|3+0#e000002&| +0#0000000&@65
@6|\+0#e000e06&|]+0#0000000&| @66
|~+0#4040ff13&| @73
Expand Down
6 changes: 3 additions & 3 deletions runtime/syntax/testdir/dumps/vim_line_continuation_99.dump
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
@6|\+0#e000e06&|}| +0#0000000&@66
@75
|l+0#af5f00255&|e|t| +0#0000000&|a+0#00e0e07&|r@1|a|y| +0#0000000&|=+0#af5f00255&| +0#0000000&|[| @61
| +0#0000e05&@5|"|\| |e|l|e|m|e|n|t| |1| +0#0000000&@56
@6|"+0#0000e05&|\| |e|l|e|m|e|n|t| |1| +0#0000000&@56
@6|\+0#e000e06&| +0#0000000&|1+0#e000002&|,+0#0000000&| @64
| +0#0000e05&@5|"|\| |e|l|e|m|e|n|t| |2| +0#0000000&@56
@6|"+0#0000e05&|\| |e|l|e|m|e|n|t| |2| +0#0000000&@56
@6|\+0#e000e06&| +0#0000000&|2+0#e000002&|,+0#0000000&| @64
| +0#0000e05&@5|"|\| |e|l|e|m|e|n|t| |3| +0#0000000&@56
@6|"+0#0000e05&|\| |e|l|e|m|e|n|t| |3| +0#0000000&@56
@6|\+0#e000e06&| +0#0000000&|3+0#e000002&| +0#0000000&@65
@6>\+0#e000e06&|]+0#0000000&| @66
@57|4|9|,|7| @9|B|o|t|
23 changes: 23 additions & 0 deletions runtime/syntax/testdir/input/vim_comments.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
" Comments

" line comment
foo() " tail comment

:Foo
"\ line continuation comment
\ arg1
"\ line continuation comment
\ arg2

" comment
\ continuing comment
\ continuing comment

echo "TOP"

" :Foo
\ arg
"\ comment
\ arg

echo "TOP"
43 changes: 43 additions & 0 deletions runtime/syntax/testdir/input/vim_expr.vim
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,46 @@ echo -0B11111111
echo 0zFF00ED015DAF
echo 0zFF00.ED01.5DAF
echo 0zFF.00.ED.01.5D.AF

" Multiline (continued) strings

let s = "
"\ comment
\ line 1
"\ comment
\ line 2
"\ comment
\" " tail comment

let s = "
\ line 1
"\ escape sequence
\\" line 2
\" " tail comment

let s = '
"\ comment
\ line 1
"\ comment
\ line 2
"\ comment
\' " tail comment

let s = $"
"\ comment
\ line 1
"\ comment
\ line 2
"\ comment
\" " tail comment

let s = $'
"\ comment
\ line 1
"\ comment
\ line 2
"\ comment
\' " tail comment

" line comment
foo() " tail comment

0 comments on commit a58db2a

Please sign in to comment.