/
CHANGELOG
300 lines (216 loc) · 8.94 KB
/
CHANGELOG
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
0.4.0
=====
* Improve the generated VimL code for Riml splat arguments in calling context
(credit to github.com/dsawardekar for idea).
* Fix multiple bugs listed here: https://github.com/luke-gru/riml/issues/31
* Fix implementation of default arguments. Previously, the generated code
would try to remove an item from the immutable `a:000`, leading to a vim
runtime error. Now, `a:000` is copied (credit to github.com/tek for idea).
0.3.9
=====
* Add splat arguments (splats in calling context). Works just like in Ruby. Example:
args = [arg1, arg2]
call do_func(*args) " same as `call do_func(arg1, arg2)`
* Performance improvements to the AST Rewriter in Ruby < 2.0.0
0.3.8
=====
* Fix issue with include re-ordering.
See [https://github.com/luke-gru/riml/issues/29]
* Fix edge-case bug where file gets compiled and output in 2 separate locations.
0.3.7
=====
* Now Ruby 1.8.7 compatible. No longer requires Ruby >= 1.9.2.
* Make error messages give consistent messages across the board, giving
a message along with file and line number information. Ex:
Riml::InvalidSuper
message: Class 'AppController' doesn't have a superclass.
location: /home/john/projects/riml_proj/lib/app_controller.riml:14
No stacktrace is shown when using riml from the commandline. To enable a full
stacktrace, use the new `--debug` commandline flag.
* Various speed improvements, particularly to the lexer.
0.3.6
=====
* Change how `for` loop works in global scope. Use script-local variables
instead of global variables.
Before: (in global scope)
for var in range(2)
echo var
end
compiled to
for var in range(2)
echo var
endfor
and now compiles to
for s:var in range(2)
echo s:var
endfor
See [https://github.com/luke-gru/riml/issues/27]
* Allow `for` loops to loop over variables with explicit scope modifiers.
for s:var in range(2)
echo 'here'
end
This now works as expected.
Related to [https://github.com/luke-gru/riml/issues/27]
* `riml_include` works much smarter now, resolving all class dependencies and
reordering the included files so that you don't need to worry about having
included files in a certain order.
See [https://github.com/luke-gru/riml/issues/21]
* Compiling Riml from commandline doesn't show stacktrace anymore if error
occurs, only the error message.
0.3.5
=====
* Rollback all file changes if error occurs during compilation. For example,
if a new file 'buffer.vim' was created from a `riml_source`, but then an error
occurs further in the compilation process of another file, 'buffer.vim' will
be deleted. If 'buffer.vim' existed previously, it will be restored to its
previous state.
`Riml.compile_files` is wrapped with file rollback capabilities now, but if,
say, you're calling `Riml.compile_files` in your own script within a loop, you
can make the whole loop transactional by wrapping it in a `Riml.with_file_rollback`
block.
ex:
filenames.each do |fname|
# this is transactional only within the compilation of __this__ file and
files that it sources.
Riml.compile_files fname
end
vs:
# Now, if an error occurs, __all__ `filenames`, as well as files they
# source, will be reverted to their previous states.
# Note that the error is still raised.
Riml.with_file_rollback do
filenames.each do |fname|
Riml.compile_files fname
end
end
* Cache SID in generated s:SID function to improve performance.
See [https://github.com/luke-gru/riml/issues/24]
0.3.4
=====
* Add `riml_import` command. `riml_import` takes a list of arguments that
can be class names or strings, and imports those classes into the system
during compilation so that no ClassNotFound errors are thrown when
encountering those classes in use without their definitions present. This
is useful for using third-party Riml libraries to make the classes they
expose available to your scripts.
Example:
riml_import g:TestUnitTestCase, g:TestUnitUtils
Now, I can use this class, and even inherit from it!
class MyTestCase < g:TestUnitTestCase
end
* Add --allow-undef-global-classes (-a) flag. This flag makes the compiler
import all global classes that it doesn't find. The same functionality can
be achieved by doing:
riml_import '*'
* Cache more heavily between calls to `Riml.compile_files`. Riml now caches
Riml.include_path and Riml.source_path files globally, as well as
rewritten ASTs.
* Only expose 'riml' as the top-level file for requiring. Move all other files
to riml/ namespace. Ex: require 'riml/parser' now instead of require 'parser'.
About time :)
0.3.3
=====
* When using `riml_include "file.vim"`, this is now cached both during one
compilation run and between calls of `Riml.compile` and `Riml.compile_files`.
In order to clear the cache, you must manually call
`Riml.include_cache.clear`.
See [https://github.com/luke-gru/riml/issues/16]
* If file A includes file B and file C, and file B also includes file C,
file C is only included __once__ in the final output code. This is in order
to specify dependencies in your included files, but not have the actual files
be included twice.
See [https://github.com/luke-gru/riml/issues/14]
* Use maximum of 4 threads when giving multiple files to compile at once.
Compiling multiple files at once can be done by
`riml -c file1.riml,file2.riml,file3.riml,file4.riml` or with
`Riml.compile_files('file1.riml', 'file2.riml', 'file3.rmil', 'file4.riml')`
Each file (and its dependencies) is compiled in its own thread, but now the
files are compiled in batches of 4 at once.
* Fix error in lexer where old code from a feature that was removed from Riml
wasn't taken out, resulting in the error `missing 1 END statement` where
that was not actually the case.
See [https://github.com/luke-gru/riml/issues/18]
* Allow omitting the '.riml' when including and sourcing files. Now,
`riml_include 'mylib'` will look first for 'mylib' in Riml.include_path,
then if that file is not found it will look for 'mylib.riml'.
See [https://github.com/luke-gru/riml/issues/6]
0.3.2
=====
* Add a blank line after every function definition to improve readability.
This can be disabled with the '--consended' flag.
See [https://github.com/luke-gru/riml/issues/5]
* `unless` condition with nested `if` inside now works properly.
Fixes [https://github.com/luke-gru/riml/issues/15]
* Allow `super` to be the right-side of an assignment. This fix is much
deeper than just this case, however, and it uncovered a rather serious bug
in how children were being added/removed/replaced in the ASTRewriter.
Fixes [https://github.com/luke-gru/riml/issues/13]
0.3.1
=====
* Fix bug where trailing whitespace [ \t\f] was causing errors for certain
statements [https://github.com/luke-gru/riml/issues/10].
0.3.0
=====
* Fix bug where variables/functions in condition clause of elseif have wrong
scope (didn't have ScopeVisitor visit the node), so was always 's:' even
if the variable was local to the function [https://github.com/luke-gru/riml/issues/10].
* Fix bug where calling function inside curly brace named function/variable
had wrong scope modifier applied to it sometimes (didn't get visited by the
ScopeVisitor). Ex:
def send(method_name, *args)
return MyLib_{method_name}(args)
end
Used to compile to:
function! s:send(method_name, ...)
return s:MyLib_{s:method_name}(a:000)
endfunction
And now compiles to:
function! s:send(method_name, ...)
return s:MyLib_{a:method_name}(a:000)
endfunction
* Improve private methods (functions in class scope defined with 'def' instead
* of 'defm'). Now they are truly private to the class and cannot be accessed
outside of it without using clever Vim trickery. Ex:
" really bad implementation of Set#push
class Set
def initialize(list)
self.__internal_list = list
end
defm push(elem)
" NOTE: Set#includes is left out of this example
add(self.internalList(), elem) unless self.includes(elem)
return self.internalList()
end
def internalList
return self.__internal_list
end
end
compiles to:
function! s:SetConstructor(list)
let setObj = {}
let setObj.__internal_list = a:list
let setObj.push = function('<SNR>' . s:SID() . '_s:Set_push')
return setObj
endfunction
function! s:Set_internalList(setObj)
return a:setObj.__internal_list
endfunction
function! <SID>s:Set_push(elem) dict
if !(self.includes(a:elem))
call add(s:Set_internalList(self), a:elem)
endif
return s:Set_internalList(self)
endfunction
We can call set.push(elem) now, but not set.internalList().
* Change class scopes from always being global ('g:') to script-local ('s:') by
default with the ability to change to global by prefixing the class name with
'g:'. Ex:
class g:Set
...
end
0.2.9
=====
* Add --output-dir (-o) commandline flag for specifying the output directory
for compiled .vim files
* Fix bug where variables in dictionaries sometimes did not have the right scope
modifier