Comments (13)
I totally agree with you on every point 👍 I'll create a branch and start working on these issues.
from riml.
Hey @luke-gru, I've noticed some improved error reporting in 0.3.6. Can you clarify the format you are using to do this? I have done some initial work in riml.vim on a syntastic plugin, but it's very experimental at the moment. If your error formats are working I can fix up the plugin to better highlight syntax errors.
from riml.
Hey @dsawardekar, sorry for the long delay. Been super busy 😄
I've just pushed a new release, 0.3.8. Since 0.3.7, there has been a new format for error messages. The format is like this https://github.com/luke-gru/riml/blob/master/lib/riml/errors.rb#L11
Riml::ParserError
location: /full/path/to/file.riml:100
message: single or multi-line error message
If the location can't be deteremined, it outputs location: <unknown>
on the second line. This should be rare, and I would consider it a bug if you encounter it.
There is a debug flag now for riml
, it's --debug
or -D
. In this case, the full stacktrace is shown.
The error messages are still a work in progress, so I'll keep this ticket open for now.
Thanks again!
from riml.
@luke-gru Np, I've been a bit busy and haven't followed up with this. This error format looks good, I'll try to incorporate it into the syntastic plugin.
from riml.
Hey Luke,
Happy 2014! I'll be getting back to this in the next few days. Will report back if I find any pesky stacktraces. 😄
from riml.
Hey @dsawardekar, happy new year to you too!
Let me know if you need any help while you're working on this. Also, I just released a new version, 0.3.9
today. The main changes are that the compiles are faster and there's a new feature called 'splat arguments', that works like Ruby's splatting in a function call context, so for instance:
args = ['arg1', 'arg2']
some_func(*args)
is equivalent to:
some_func('arg1', 'arg2')
Thanks!
from riml.
@luke-gru I've upgraded most of my stuff to 0.3.9. Every thing looks ok. The syntastic plugin api appears to have changed, riml.vim's syntax checker is currently broken as a result. Need to rethink some of my assumptions.
The splats syntax look handy, but the generated code is a bit involved. Could it be moved to a call call
invocation? Something like below,
function! Some_Func(...)
echomsg string(a:000)
endfunction
let args = ['a', 'b']
call call('Some_Func', args)
from riml.
@dsawardekar I agree the generated code is not ideal, I was wondering what the best way to do it would be. That looks much easier! I'll make the change some time this week for sure.
Thanks!
from riml.
@luke-gru I took another look at the Syntax checker. Vim's errorformat needs to match a %f
against a filename to work. Currently the compiler errors don't include the filename in the returned error. Can you add a file
line to the output?
Riml::ParseError
file: lib/foo.riml
location: <String>:3
message: parse error on value "\n" (NEWLINE)
Currently for the following code,
class Foo
defm foo(
end
end
The error output is,
Riml::ParseError
location: <String>:3
message: parse error on value "\n" (NEWLINE)
from riml.
Hi @dsawardekar, sorry for the delay on this issue.
I'll have time from no on to dedicate more time to this project. Are you compiling this from the commandline, or are you using the Ruby API (Riml.compile
)?
Thanks,
from riml.
Now worries @luke-gru. As much as I like Vim, it doesn't put food on the plate. 😄
I'm using the the command line in this case, so basically a riml -c
. Not sure if it makes any difference but the riml executable is called by syntastic.
from riml.
Hey @dsawardekar, I can't reproduce the error for some reason.
I put the code (class Foo ...
) in a file called test.riml
and ran the command riml -c test.riml
, and got this output:
Riml::ParseError
location: test.riml:3
message: parse error on value "\n" (NEWLINE)
I get this for versions 0.3.9
and the newly released 0.4.0
(:tada:). Can you try this again?
Also, in 0.4.0
, your suggestion for using call('function_name', args_list)
is in the release, so there's no more of that awkward code generation, and it makes the rewriter much easier to understand! 👍 Thanks!
from riml.
That's odd I can't reproduce this anymore, I'll investigate further. 0.4.0 looks really good, I have some upgrading to do! 😄
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
- class method name generation error HOT 6
- 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.