Julien Pagès [Fri, 13 Mar 2015 15:51:08 +0000 (16:51 +0100)]
niti: Introduce a method to create and initialize a Frame
Signed-off-by: Julien Pagès <julien.projet@gmail.com>
Julien Pagès [Fri, 13 Mar 2015 15:46:46 +0000 (16:46 +0100)]
niti: Introduce and use a virtual type for the frames
Signed-off-by: Julien Pagès <julien.projet@gmail.com>
Julien Pagès [Tue, 10 Feb 2015 16:08:19 +0000 (17:08 +0100)]
nitvm: The local variables are numbered
The access to them is made by their position in this array
Signed-off-by: Julien Pagès <julien.projet@gmail.com>
Jean Privat [Thu, 12 Mar 2015 05:59:10 +0000 (12:59 +0700)]
Merge: lib/noise: fix gradient_vector to return a unit vector
This was an error in the previous implementation. It will now produce noise with a better/greater amplitude so they are... noisier.
The sample result of InterpolatedNoise shows that it now uses the full amplitude, from 0 to f. The sample result of PerlinNoise uses 1 to d, which is a reasonable portion of the full amplitude of 16 considering that it uses only 4 layers and thus the real amplitude is of 15 (8+4+2+1).
Pull-Request: #1200
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Thu, 12 Mar 2015 05:59:00 +0000 (12:59 +0700)]
Merge: tests: add bench_strfib.nit
A simple program that recursively build and concatenate strings.
Pull-Request: #1198
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Thu, 12 Mar 2015 05:58:53 +0000 (12:58 +0700)]
Merge: mnit tileset and numbers
Features from WBTW, used mainly to set the size of in-game hints and events boxes.
These modules are for Mnit but will be ported to Gamnit someday...
Pull-Request: #1196
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexis Laferrière [Wed, 11 Mar 2015 14:14:10 +0000 (10:14 -0400)]
lib/noise: fix gradient_vector to return a unit vector
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 11 May 2014 00:49:57 +0000 (20:49 -0400)]
lib/numbers: remove `NumberImages` constructors for spec and to make it public
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 10 Mar 2015 21:21:23 +0000 (17:21 -0400)]
lib/tileset: fix typos in doc
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 17 Nov 2014 17:59:49 +0000 (12:59 -0500)]
lib/tileset: intro `TileSetFont::text_width`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 17 Nov 2014 15:33:18 +0000 (10:33 -0500)]
lib/tileset: intro `TileSetFont::text_height`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 25 Aug 2014 19:31:29 +0000 (15:31 -0400)]
lib/tileset: intro `TileSetFont::advance`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Wed, 11 Mar 2015 01:01:48 +0000 (08:01 +0700)]
tests: add bench_strfib.nit
A simple program that recursively build and concatenate strings.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 10 Mar 2015 23:38:32 +0000 (06:38 +0700)]
Merge: Noise generators: Perlin and interpolated
Intro the PerlinNoise generator and the underlying (but independent) InterpolatedNoise, with some related services.
The rosetta code Perlin noise example (in 3D) is for comparison to my implementation in `lib/noise.nit` in (2D). We do not get the expected result with this implementation, 0.
13691995878400010 vs 0.
13691995878400012. It may be an error in the implementation of `Float.to_precision`... this will require further investigation.
The optimized `SequenceRead::rand` is a bonus! it is not used in this PR.
Pull-Request: #1194
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Tue, 10 Mar 2015 13:51:12 +0000 (20:51 +0700)]
Merge: Abstract attribute
Add the annotation `abstract` on attributes.
It is just a syntactic sugar to define a couple of abstract getter-setters with a shared documentation without an associated slot in the instance so it can be used in interfaces.
~~~nit
interface Foo
var a: Object is abstract
end
class Bar
super Foo
# A concrete attribute that redefine the abstract one
redef var a
end
class Baz
super Foo
var real_a: Object
# A pair of concrete methods that redefine the abstract attribute
redef fun a do return real_a
redef fun a=(x) do real_a = x
end
~~~
The visibility rules are unchanged with regard to concrete attributes, so by default the writer is private.
Needed cleaning (and a bugfix) are included in the PR
Pull-Request: #1177
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Tue, 10 Mar 2015 13:51:03 +0000 (20:51 +0700)]
Merge: Faster buffers
Make flatbuffers a little faster on substrings
for nitc/nitc/nitc
before: 0m7.168s
after: 0m7.068s (-1.4%)
Pull-Request: #1189
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Fri, 6 Mar 2015 13:09:05 +0000 (20:09 +0700)]
lib/stream: BufferedReader return the buffer if less than asked to read
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 6 Mar 2015 13:00:48 +0000 (20:00 +0700)]
lib/string: faster substring for FlatBuffer
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 9 Mar 2015 01:37:38 +0000 (08:37 +0700)]
lib/string: document FlatString::with_infos
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 10 Mar 2015 10:10:38 +0000 (17:10 +0700)]
Merge: Serialization phase skips abstract classes and add depth option to nitserial
This is a minor fix and new feature for the serialization support.
* Prevents bug where the serialization phase create constructors for abstract classes.
* Nitserial generates the generics support code for different depths: single module, group or project.
Note that the serialization does not support fully the new constructors. But it can still be used on small classes that do not use any "fancy" constructor features.
Pull-Request: #1193
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 10 Mar 2015 10:10:31 +0000 (17:10 +0700)]
Merge: Vim autocomplete search in doc and 2 new useful Vim functions
* The omnifunc for Nit search for autocomplete suggestions in the doc. So if you write `12.modulo`, then hit `Ctrl-X Ctrl-O` (launching the omnifunc), it will suggest `%` to replace the `modulo` part. This is useful when guessing the name of the wanted entity.
* The Nitdoc function can be mapped to `Ctrl-D` to show the doc associated to the word under the cursor. There is still no semantic analysis here, so it will list all possible docs.
* The NitGitGrep function can be mapped to `Ctrl-G` to find instances of the word under the cursor in the currect directory using `git grep`. It will first try to display any definitions and then its uses. This one is a bit trickier to use, but it can be very useful.
----
Bonus hint! You can select the size of the preview window to 5 lines with `set previewheight=5` (@Morriar)
Pull-Request: #1192
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Fri, 6 Mar 2015 21:07:38 +0000 (16:07 -0500)]
examples: add the Perlin noise Rosetta code example
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 5 Mar 2015 19:14:37 +0000 (14:14 -0500)]
lib: intro 2 noise generators
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 16 Nov 2014 01:26:46 +0000 (20:26 -0500)]
nitserial: add depth option
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 9 Mar 2015 20:53:41 +0000 (16:53 -0400)]
lib: intro `Float::log_base`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 4 Mar 2015 02:01:52 +0000 (21:01 -0500)]
lib: intro `Float.lerp` for simple linear interpolation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 4 Mar 2015 02:00:35 +0000 (21:00 -0500)]
lib: add an optimized `SequenceRead[E].rand`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 16 Nov 2014 01:57:17 +0000 (20:57 -0500)]
nitserial: do not generate constructors for abstract classes
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 9 Mar 2015 17:36:29 +0000 (13:36 -0400)]
misc/vim: search in synopsis and full doc for matches
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 4 Mar 2015 02:47:05 +0000 (21:47 -0500)]
misc/vim: use case insensitive search for entity names
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 8 Mar 2015 00:10:00 +0000 (19:10 -0500)]
vim autocomplete: always write generated doc to metadata files
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 8 Mar 2015 00:09:09 +0000 (19:09 -0500)]
misc/vim: add a function to search for instances of the word under the cursor
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 7 Mar 2015 04:21:55 +0000 (23:21 -0500)]
misc/vim: add a function to show the doc of the entity under the cursor
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 7 Mar 2015 04:21:05 +0000 (23:21 -0500)]
misc/vim: extract the service to find metadata files from the omnifunc
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Sat, 7 Mar 2015 05:17:35 +0000 (12:17 +0700)]
Merge: Optimize nitc
Some minor optimizations after looking at reports of valgrind.
Pull-Request: #1191
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Sat, 7 Mar 2015 05:17:28 +0000 (12:17 +0700)]
Merge: Reuse Array Iterators
on nitc/nitc/nit this reduce a lot the number of allocated iterators.
before:
* 0m7.168s
* 2,706,498 new ArrayIterator
* the second most allocated class (after NativeArray)
after:
* 0m7.060s (-1.5%)
* 785,781 new ArrayIterator (-70%)
* the 7th most allocated class
Pull-Request: #1190
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Sat, 7 Mar 2015 05:17:21 +0000 (12:17 +0700)]
Merge: More lazyness in standard
Make lazy some attributes of often used classes. So that the attribute creation cost only when they are really used.
More impact that initially imagined:
for nitc/nitc/nitc
before: 7.188
after: 7.008 (-2.5%)
Pull-Request: #1188
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Sat, 7 Mar 2015 05:17:11 +0000 (12:17 +0700)]
Merge: Autosuperinit in refinements
Remove an old FIXME for compatibility with the old nitc that prevents the inclusion of autosuperinit calls in refinements.
Close #1186 (thus bring back the the feature from #916)
Pull-Request: #1187
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Sat, 7 Mar 2015 05:17:01 +0000 (12:17 +0700)]
Merge: Extends chars, string and stream with some whitespace-related function
While thinking about the remaining task of #466 (simple parsing), I though that there useful functions where missing in order to have a sane `Reader::read_word` method
Pull-Request: #1179
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Fri, 6 Mar 2015 16:43:15 +0000 (23:43 +0700)]
tests: update test_new_native_alt1.res because line change
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 6 Mar 2015 16:24:55 +0000 (23:24 +0700)]
lib/poset: avoid useless call of `to_a` in `add_edge`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 6 Mar 2015 15:44:58 +0000 (22:44 +0700)]
compiler: do not initialize attributes at NULL in NEW_*
is is already done by the zeroing
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 6 Mar 2015 15:33:22 +0000 (22:33 +0700)]
lib/array: remember the last used iterator so it could be used again
on nitc/nitc/nit this reduce a lot the number of allocated iterators.
before:
* 0m7.168s
* 2,706,498 new ArrayIterator
* the second most allocated class (after NativeArray)
after:
* 0m7.060s (-1.5%)
* 785,781 new ArrayIterator (-70%)
* the 7th most allocated class
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 6 Mar 2015 14:18:35 +0000 (21:18 +0700)]
astvalidatior: small refactorisation to make it more efficient
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 6 Mar 2015 13:47:59 +0000 (20:47 +0700)]
phase: do not display the each phase for each module
it is noise at this point
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 27 Feb 2015 14:31:23 +0000 (21:31 +0700)]
tests: update sav/nituml_args*.res because the new method `is_whitespace` in Char
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 27 Feb 2015 05:09:21 +0000 (12:09 +0700)]
stream: add `read_word` and `read_nonwhitespace`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 27 Feb 2015 05:06:27 +0000 (12:06 +0700)]
string: add `is_whitespace`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 27 Feb 2015 05:06:06 +0000 (12:06 +0700)]
string: update *trim to use `is_whitespace`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 6 Mar 2015 04:07:54 +0000 (11:07 +0700)]
lib/map: make concrete `Map.keys` and `Map.values` lazy
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 6 Mar 2015 04:07:21 +0000 (11:07 +0700)]
lib/map: document `Map.has_key` and implement it efficienlty
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 6 Mar 2015 03:54:47 +0000 (10:54 +0700)]
lib/string: make FlatString#chars lazy
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 6 Mar 2015 03:54:17 +0000 (10:54 +0700)]
lib/file: make stdin, stdout and strerr lazy
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 6 Mar 2015 03:53:54 +0000 (10:53 +0700)]
lib/file: move the call of `stdout.set_buffering_mode` to Stdout
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 6 Mar 2015 03:08:34 +0000 (10:08 +0700)]
tests: add base_init_raf2.nit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 6 Mar 2015 03:07:48 +0000 (10:07 +0700)]
autosuperinit: remove old FIXME that prevented autosuperinit in redefs
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 6 Mar 2015 03:06:59 +0000 (10:06 +0700)]
autosuperinit: verbose info for debuging
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 6 Mar 2015 03:06:18 +0000 (10:06 +0700)]
parser: fix default init for ALabel and ASelfExpr
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 3 Mar 2015 15:05:33 +0000 (22:05 +0700)]
Merge: compiler: fast path is the hot path in once and literal strings
`once` structure and literal strings are implemented with a guard so that
onced-expression and literal strings are evaluated/created once then
stored in a static variable.
This patch just informs GCC that the fast path (get the saved value)
it the frequent path. It's up to GCC to do something useful with this
information.
It seems it does since number for nitc/nitc/nitc are
before: 0m7.324s
after: 0m7.156s (-2.3%)
Pull-Request: #1183
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Tue, 3 Mar 2015 15:05:12 +0000 (22:05 +0700)]
Merge: Inline intern methods in standard objects
Those in primitive types where already inlined, this time it is the ones in Object, NativeArray and other.
A special case remain for `object_id` since the value in standard objects is redefined in primitive type.
So this one is not inlined.
The gain in nitc/nitc/nitc is less that I expected but not that bad.
before: 0m7.276s
after: 0m7.100s (-2.5%)
Bonus: an old bug related to native arrays in --semi-global related to inlining is also fixed.
Pull-Request: #1180
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Tue, 3 Mar 2015 15:04:56 +0000 (22:04 +0700)]
Merge: Introduce Cloneable interface
As exposed by #917 a standard API to clone objects could be useful.
This PR propose a Cloneable interface that class can implement.
The specif semantic of what a clone is is domain-dependent, the only suggestion I define is to be POLA and to consider the post condition `self == clone`. It seems sane since the precise semantic of `==` is also domain-dependent. The post-condition is not mandatory since not all classes redefines `==` and maybe some classes could be cloneable without being `==`-able. The reason is that `clone` is instantaneous but the semantic `==` should remain valid all the time. For instance, It could make sense to clone some Iterators but I am not sure what is a sane definition of `==` on them.
As a POC, clone is implemented is the three Array-related classes, Array, ArraySet and ArrayMap.
Pull-Request: #1176
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Mon, 2 Mar 2015 06:42:55 +0000 (13:42 +0700)]
compiler: fast path is the hot path in once and literal strings
`once` structure and literal strings are implemented with a guard so that
onced-expression and literal strings are evaluated/created once then
stored in a static variable.
This patch just informs GCC that the fast path (get the saved value)
it the frequent path. It's up to GCC to do something useful with this
information.
It seems it does since number for nitc/nitc/nitc are
before: 0m7.324s
after: 0m7.156s (-2.3%)
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 28 Feb 2015 11:00:15 +0000 (18:00 +0700)]
version 0.7.2
Jean Privat [Thu, 26 Feb 2015 11:39:41 +0000 (18:39 +0700)]
tests: update because changes in kernel and array
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 21 Feb 2015 16:15:28 +0000 (23:15 +0700)]
lib/array: Array, ArraySet and ArrayMap are cloneable
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 21 Feb 2015 16:06:15 +0000 (23:06 +0700)]
kernel: new interface `Cloneable` to provide a `clone` method
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 27 Feb 2015 14:19:05 +0000 (21:19 +0700)]
tests: remove nitg-sg/fixme/test_gen.res because native arrays is fixed
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 27 Feb 2015 14:02:54 +0000 (21:02 +0700)]
sepcomp: shortcut an inline most intern methods of Object
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 27 Feb 2015 13:59:57 +0000 (20:59 +0700)]
sepcomp: extract `direct_call` from `compile_callsite`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 27 Feb 2015 13:58:55 +0000 (20:58 +0700)]
sepcomp: fix compilation of NativeArray[] in an inlined context.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 27 Feb 2015 05:05:28 +0000 (12:05 +0700)]
kernel: add Char::is_whitespace
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 27 Feb 2015 02:51:36 +0000 (09:51 +0700)]
Merge: Use --log
Use the option --log to log things.
It is not that hard to add logged things and it helped me, in #1177, to track easily the bug in rta.
Pull-Request: #1178
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Fri, 27 Feb 2015 02:51:25 +0000 (09:51 +0700)]
Merge: Kill cached
Remove the deprecated annotation `is cached` that is fragile and replace the remaining cases with `lazy` attributes that is the way to go.
Pull-Request: #1175
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Sat, 21 Feb 2015 16:04:28 +0000 (23:04 +0700)]
collection: implements `MapRead::==`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2015 23:52:38 +0000 (06:52 +0700)]
Merge: Nitrpg: add achievements
Not much achievements in this PR:
* Counting issues and rewarding at 1, 100, 1000
* Counting PR and rewarding at 1, 100, 1000
* Counting commits and rewarding at 1, 100, 1000, 10000
* Two achievements based on regexp, just for demo: Nitdoc and FFI
Partially fixes #1165: I fixed the typo in "complaint" and the first playre to unlock the achievement. But the related issue stills not linked for now.
Démo: http://nitlanguage.org/rpg/games/privat/nit (sorry, I had to reset the scores...)
Pull-Request: #1171
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Thu, 26 Feb 2015 13:58:07 +0000 (20:58 +0700)]
tests: tests --log and --log-dir for nitc
So we can check that this rare path does not crashes
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2015 13:56:29 +0000 (20:56 +0700)]
man: document --log and --log-dir
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2015 13:45:27 +0000 (20:45 +0700)]
rta: log results of analysis in the log directory
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2015 13:43:55 +0000 (20:43 +0700)]
toolcontext: log all verbose infos in the log directory
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2015 13:08:32 +0000 (20:08 +0700)]
tests: update other tests related to minor attr changes
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2015 13:04:53 +0000 (20:04 +0700)]
tests: add base_attr_abstract.nit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2015 13:02:37 +0000 (20:02 +0700)]
src: do not crash if there is not MAttributeDef in AAttrPropdef (abstract attribute)
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2015 13:01:11 +0000 (20:01 +0700)]
modelize: new annotation `abstract` on attribute that just generate abstract accessors
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2015 12:59:48 +0000 (19:59 +0700)]
modelize: the main property of a attribute is the reader. So be it.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2015 12:56:06 +0000 (19:56 +0700)]
rta: do not drop abstract methods. abstract method can be live in Nit.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2015 12:55:12 +0000 (19:55 +0700)]
engines: move compilation of `abstract` method to MMethodDef
Model things are better than AST things.
Signed-off-by: Jean Privat <jean@pryen.org>
Alexandre Terrasa [Mon, 23 Feb 2015 09:57:07 +0000 (10:57 +0100)]
contrib/nitrpg: display achievements in front end
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 26 Feb 2015 12:13:18 +0000 (13:13 +0100)]
contrib/nitrpg: introduce achievements
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Thu, 26 Feb 2015 11:41:14 +0000 (18:41 +0700)]
tests: remove base_at_cached.nit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2015 07:48:16 +0000 (14:48 +0700)]
glesv2: fix bad use of `lazy` annotation (fun instead of var)
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2015 07:47:15 +0000 (14:47 +0700)]
nitrpg: implement correct caching for User::player
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2015 04:51:02 +0000 (11:51 +0700)]
modelize: prevent the use of `lazy` on methods
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2015 04:50:42 +0000 (11:50 +0700)]
frontend: remove deprecated cached annotation and phase
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2015 04:08:14 +0000 (11:08 +0700)]
code: replace `is cached` by `is lazy`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 26 Feb 2015 02:23:36 +0000 (09:23 +0700)]
Merge: Guard call
Add option `--guard-call` as an alternative implementation of the link-time optimization `--substitute-monomorph`
The idea is to have the standard VFT call guarded by a symbol when the call is monomorphic.
So the sequence is independent of any client and is roughly
~~~
if SYMBOL != null then
SYMBOL(ARGS)
else
(SELF->VFT[COLOR])(ARGS)
end
~~~
where the value of the SYMBOL is set for each specific program at link-time: null when the call is polymorphic and the address of the single target when the call is monomorphic.
Benches show that, on my computer, there is from 0% to 10% in loss so this alternative implementation is pure overcost :)
Still keep it because, I coded it and works, and it may worth something on other architectures.
The benchs shows some quick results:
* first (sc, red) is default
* second (sl, green) is `--substitute-monomorph`, the previous impl
* third (gc, blue) is `--guard-call``, the new one
* last (cd, purple) is `--direct-call-monomorph0`, the optimal with direct calls directly inserted in a global way
![bench_linkboost](https://cloud.githubusercontent.com/assets/135828/6342973/
794b2a92-bc13-11e4-9b22-
cc43e6cda473.png)
Even if the result is deceiving, the PR does some cleanup and refactorization, so we got that goin for us, which is nice.
Pull-Request: #1173
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Thu, 26 Feb 2015 02:23:27 +0000 (09:23 +0700)]
Merge: Nitdoc: HTML templates related cleaning
This PR reorganizes Nitdoc modules importation for HTML templates.
The main objective is to dissociate `doc_model` from html related things.
This is the last step before template migration from old model templates to `DocComposite`.
Pull-Request: #1172
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Thu, 26 Feb 2015 02:23:18 +0000 (09:23 +0700)]
Merge: Generalized class members
This PR change the way class members are parsed.
Before, the order was strict: class annotations, then extern code block, then super clauses, then properties.
After, annotations and super clauses can appear in any order within the properties
The need is to enable class annotations inside the class (cf #1158) I did not find another simple way to do this.
Now, one can write
~~~nit
class B
super A
serializable
var i: Int
autoinit x, i
end
~~~
Pull-Request: #1159
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Tue, 24 Feb 2015 16:15:26 +0000 (23:15 +0700)]
nitpretty: handle super and class-level annotation as property
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 24 Feb 2015 16:12:19 +0000 (23:12 +0700)]
tests: update test_parser_args1.res
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 21 Feb 2015 02:58:22 +0000 (09:58 +0700)]
serialization: generate ASuperPropdef instead of ASuperclass
Signed-off-by: Jean Privat <jean@pryen.org>