Skip to content

Commit ba0e4fc

Browse files
committed
throw error with unknown parser command
1 parent ba3af9f commit ba0e4fc

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

autoload/vimlparser.vim

+2
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,8 @@ function! s:VimLParser._parse_command(parser) abort
893893
call self.parse_wincmd()
894894
elseif a:parser == 'parse_cmd_syntax'
895895
call self.parse_cmd_syntax()
896+
else
897+
throw printf('unknown parser: %s', string(a:parser))
896898
endif
897899
endfunction
898900

js/vimlparser.js

+3
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,9 @@ VimLParser.prototype._parse_command = function(parser) {
11611161
else if (parser == "parse_cmd_syntax") {
11621162
this.parse_cmd_syntax();
11631163
}
1164+
else {
1165+
throw viml_printf("unknown parser: %s", viml_string(parser));
1166+
}
11641167
}
11651168

11661169
VimLParser.prototype.find_command = function() {

py/vimlparser.py

+2
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,8 @@ def _parse_command(self, parser):
937937
self.parse_wincmd()
938938
elif parser == "parse_cmd_syntax":
939939
self.parse_cmd_syntax()
940+
else:
941+
raise VimLParserException(viml_printf("unknown parser: %s", viml_string(parser)))
940942

941943
def find_command(self):
942944
c = self.reader.peekn(1)

0 commit comments

Comments
 (0)