-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class method name generation error #30
Comments
Hi @tek, Thanks for the detailed report. The Can you paste a small standalone example that will reproduce this error so I can have a better idea of what's going on? Thanks, |
Then doing function! s:MyClassConstructor()
let myClassObj = {}
let myClassObj.foo = function('<SNR>' . s:SID() . '_s:MyClass_foo')
return myClassObj
endfunction
function! <SID>s:MyClass_foo() dict
endfunction
let s:foo = s:MyClassConstructor()
btw, I wrote 'excluded' in the first post when I meant 'included'. |
Ah I see, thanks. Are you compiling from the commandline, or running riml interactively ( I get the following output when saving your example in a file function! s:SID()
if exists('s:SID_VALUE')
return s:SID_VALUE
endif
let s:SID_VALUE = matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
return s:SID_VALUE
endfunction
function! s:MyClassConstructor()
let myClassObj = {}
let myClassObj.foo = function('<SNR>' . s:SID() . '_s:MyClass_foo')
return myClassObj
endfunction
function! <SID>s:MyClass_foo() dict
endfunction
let s:foo = s:MyClassConstructor() When running riml interactively, the generated |
ah, alright. I am using |
After updating vim today, the |
FWIW, this is working at first glance: https://github.com/tek/riml/commit/9d2131f1ceb1ca5e4a6cfc14d4d56bbdeea4c3dd |
I upgraded from 0.2.9 today and it broke class generation. when trying to instantiate a class, I get the error
I put a debug output statement into ast_rewriter.rb and a SID node is excluded in the rewritten syntax tree, though it's not present in the generated viml file.
If I just paste it on top of the riml file (in VimL), everything's fine.
Also, the generated methods look like
Isn't the
s:
superfluous?The text was updated successfully, but these errors were encountered: