Permalink
Browse files

fix parse_cmd_syntax

  • Loading branch information...
1 parent 0e91d5a commit 3c15c6a9019f1c2762aa599fe1ad7e58d897f203 @haya14busa committed Sep 28, 2016
Showing with 21 additions and 1 deletion.
  1. +15 −1 autoload/vimlparser.vim
  2. +3 −0 test/test_syncmd.ok
  3. +3 −0 test/test_syncmd.vim
@@ -1939,7 +1939,21 @@ endfunction
" FIXME: validate argument
function! s:VimLParser.parse_cmd_syntax()
- let end = self.separate_nextcmd()
+ let end = self.reader.getpos()
+ while s:TRUE
+ let end = self.reader.getpos()
+ let c = self.reader.peek()
+ if c == "/" || c == "'" || c == "\""
+ call self.reader.getn(1)
+ call self.parse_pattern(c)
+ elseif c == "="
+ call self.reader.getn(1)
+ call self.parse_pattern(" ")
+ elseif self.ends_excmds(c)
+ break
+ endif
+ call self.reader.getn(1)
+ endwhile
let node = s:Node(s:NODE_EXCMD)
let node.pos = self.ea.cmdpos
let node.ea = self.ea
View
@@ -3,3 +3,6 @@
(excmd "syntax")
(excmd "syntax enable")
(excmd "syntax list GroupName")
+(excmd "syn match pythonError \"[&|]\\{2,}\" display")
+(excmd "syntax match qfFileName /^\\zs\\S[^|]\\+\\/\\ze[^|\\/]\\+\\/[^|\\/]\\+|/ conceal cchar=+")
+(excmd "syntax region jsString start=+\"+ skip=+\\\\\\(\"\\|$\\)+ end=+\"\\|$+ contains=jsSpecial,@Spell extend")
@@ -2,3 +2,6 @@ if 1 | syntax on | endif
syntax
syntax enable
syntax list GroupName
+syn match pythonError "[&|]\{2,}" display
+syntax match qfFileName /^\zs\S[^|]\+\/\ze[^|\/]\+\/[^|\/]\+|/ conceal cchar=+
+syntax region jsString start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contains=jsSpecial,@Spell extend

0 comments on commit 3c15c6a

Please sign in to comment.