@@ -335,6 +335,7 @@ function s:PythonCompiler.compile_function(node)
335335 if left == ' new'
336336 return
337337 endif
338+ call self .emptyline ()
338339 call insert (rlist, ' self' )
339340 call self .incindent (' ' )
340341 call self .out (' def %s(%s):' , left , join (rlist, ' , ' ))
@@ -343,12 +344,13 @@ function s:PythonCompiler.compile_function(node)
343344 call self .decindent ()
344345 call self .decindent ()
345346 else
347+ call self .emptyline ()
348+ call self .emptyline ()
346349 call self .out (' def %s(%s):' , left , join (rlist, ' , ' ))
347350 call self .incindent (' ' )
348351 call self .compile_body (a: node .body)
349352 call self .decindent ()
350353 endif
351- call self .emptyline ()
352354endfunction
353355
354356function s: PythonCompiler .compile_delfunction (node)
@@ -376,9 +378,13 @@ function s:PythonCompiler.compile_let(node)
376378 if a: node .left isnot s: NIL
377379 let left = self .compile (a: node .left )
378380 if left == ' LvalueParser'
381+ call self .emptyline ()
382+ call self .emptyline ()
379383 call self .out (' class LvalueParser(ExprParser):' )
380384 return
381385 elseif left = ~ ' ^\(VimLParser\|ExprTokenizer\|ExprParser\|LvalueParser\|StringReader\|Compiler\|RegexpParser\)$'
386+ call self .emptyline ()
387+ call self .emptyline ()
382388 call self .out (' class %s:' , left )
383389 return
384390 elseif left = ~ ' ^\(VimLParser\|ExprTokenizer\|ExprParser\|LvalueParser\|StringReader\|Compiler\|RegexpParser\)\.'
@@ -763,7 +769,7 @@ function s:PythonCompiler.compile_list(node)
763769endfunction
764770
765771function s: PythonCompiler .compile_dict (node)
766- let value = map (a: node .value, ' self.compile(v:val[0]) . ":" . self.compile(v:val[1])' )
772+ let value = map (a: node .value, ' self.compile(v:val[0]) . ": " . self.compile(v:val[1])' )
767773 if empty (value)
768774 return ' AttributeDict({})'
769775 else
@@ -828,14 +834,16 @@ let s:viml_builtin_functions = map(copy(s:VimLParser.builtin_functions), 'v:val.
828834let s: script_dir = expand (' <sfile>:h' )
829835function ! s: convert (in , out)
830836 let vimlfunc = fnamemodify (s: script_dir . ' /vimlfunc.py' , ' :p' )
831- let head = readfile (vimlfunc)
837+ let head = readfile (vimlfunc) + [ ' ' , ' ' ]
832838 try
833839 let r = s: StringReader .new (readfile (a: in ))
834840 let p = s: VimLParser .new ()
835841 let c = s: PythonCompiler .new ()
836842 let lines = c .compile (p .parse (r ))
837843 unlet lines [0 : index (lines , ' NIL = []' ) - 1 ]
838844 let tail = [
845+ \ ' ' ,
846+ \ ' ' ,
839847 \ ' if __name__ == '' __main__'' :' ,
840848 \ ' main()' ,
841849 \ ]
0 commit comments