To: vim_dev@googlegroups.com Subject: Patch 9.0.1083 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1083 Problem: Empty and comment lines in a class cause an error. Solution: Skip empty and comment lines. (closes #11734) Files: src/vim9class.c, src/testdir/test_vim9_class.vim *** ../vim-9.0.1082/src/vim9class.c 2022-12-19 12:18:06.404218717 +0000 --- src/vim9class.c 2022-12-20 13:34:57.060327373 +0000 *************** *** 248,253 **** --- 248,263 ---- break; char_u *line = skipwhite(theline); + // Skip empty and comment lines. + if (*line == NUL) + continue; + if (*line == '#') + { + if (vim9_bad_comment(line)) + break; + continue; + } + char_u *p = line; if (checkforcmd(&p, "endclass", 4)) { *** ../vim-9.0.1082/src/testdir/test_vim9_class.vim 2022-12-18 21:42:49.014716925 +0000 --- src/testdir/test_vim9_class.vim 2022-12-20 13:37:34.984409558 +0000 *************** *** 131,136 **** --- 131,137 ---- this.lnum: number this.col: number + # make a nicely formatted string def ToString(): string return $'({this.lnum}, {this.col})' enddef *************** *** 155,160 **** --- 156,162 ---- this.lnum: number = 1 this.col: number = 1 + # constructor with only the line number def new(lnum: number) this.lnum = lnum enddef *** ../vim-9.0.1082/src/version.c 2022-12-19 20:42:45.884055099 +0000 --- src/version.c 2022-12-20 13:35:53.608365913 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1083, /**/ -- ARTHUR: Be quiet! DENNIS: --but by a two-thirds majority in the case of more-- ARTHUR: Be quiet! I order you to be quiet! WOMAN: Order, eh -- who does he think he is? ARTHUR: I am your king! The Quest for the Holy Grail (Monty Python) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///