1
1
source ./go/ gocompiler.vim
2
2
source ./go/ typedefs.vim
3
3
4
- call extend (s: , g: ImportGoCompiler ())
4
+ call extend (s: , ImportGoCompiler ())
5
5
6
6
function ! s: generate ()
7
7
let gofile = ' go/vimlparser.go'
@@ -16,7 +16,7 @@ function! s:generate()
16
16
17
17
try
18
18
let ast = s: ast ()
19
- let c = s: GoCompiler .new (g: ImportTypedefs ())
19
+ let c = s: GoCompiler .new (ImportTypedefs ())
20
20
let lines = c .compile (ast)
21
21
call writefile (head + lines , gofile)
22
22
catch
@@ -28,23 +28,13 @@ function! s:ast() abort
28
28
let vimfile = ' autoload/vimlparser.vim'
29
29
let astfile = ' go/vimlparser.ast.vim'
30
30
31
- let cache = {}
32
- if filereadable (astfile)
33
- " sandbox return js_decode(readfile(astfile)[0])
34
- let cache = js_decode (readfile (astfile)[0 ])
35
- " return deepcopy(cache)
36
- " XXX: cache doesn't work.... why...
37
- endif
38
-
39
31
let lines = readfile (vimfile)
40
32
unlet lines [0 : index (lines , ' let s:FALSE = 0' )]
41
33
unlet lines [index (lines , ' let s:RegexpParser = {}' ):-2 ]
42
34
let r = s: StringReader .new (lines )
43
35
let p = s: VimLParser .new ()
44
36
let ast = p .parse (r )
45
- echom ' (ast == cache) == ' . (ast == cache)
46
37
return ast
47
- " return cache
48
38
endfunction
49
39
50
40
function ! s: numtoname (num)
0 commit comments