Comments (6)
Hi @tek,
Thanks for the detailed report. The s:
is superfluous, but to my knowledge it does no harm. I'm not sure if that's what the problem is here or not.
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,
from riml.
class MyClass
defm foo
end
end
foo = new MyClass()
Then doing runtime autoload/foo.vim
would be enough.
The output file:
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()
s:SID()
obviously can't be there, do I miss an import or something?
btw, I wrote 'excluded' in the first post when I meant 'included'.
from riml.
Ah I see, thanks. Are you compiling from the commandline, or running riml interactively (riml -i
)?
I get the following output when saving your example in a file foo.riml
and running riml -c foo.riml
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 s:SID
function is left off, but maybe that is confusing behaviour.
from riml.
ah, alright. I am using guard-shell
with a Guardfile I created some months ago, that was using riml -s < #{infile} > ${outfile}
âĻI guess SID()
is being omitted in stdin mode, too. using -c
, I get the correct results.
from riml.
After updating vim today, the <sid>s:
seems to be illegal now.
from riml.
FWIW, this is working at first glance: https://github.com/tek/riml/commit/9d2131f1ceb1ca5e4a6cfc14d4d56bbdeea4c3dd
from riml.
Related Issues (20)
- Cache riml_includes between compile_files HOT 11
- Syntax error with dot access of "append" property on argument HOT 2
- Functions starting with uppercase letter HOT 2
- Make 1.8.7 compatible HOT 1
- smarter `riml_include` re-orders inclusions based off dependency graph for classes HOT 10
- add `riml_import` for importing classes. Once imported, you can use them without 'undefined class' errors. HOT 2
- Cache SID result HOT 2
- Minimum and Recommended version of Vim for `riml` generated code HOT 4
- `for` statement in global scope pollutes global variables HOT 3
- Functions that handle range HOT 2
- Upgrading to riml 0.3.7 doesn't pickup some classes in path HOT 4
- exception when calling method on a list item in one statement HOT 13
- bug in boolean assignment
- calling self method with splat args fails
- Calling super in a class without extending a parent class HOT 1
- Strings with interpolation don't work with escaped single quotes.
- The pyeval function is not treated as a system function
- Viml generated by Riml is incompatible with Vim p260 or higher HOT 3
- Variables inside function should compile to local to function scope
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. đđđ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â¤ī¸ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from riml.