Jean Privat [Sat, 30 May 2015 00:37:16 +0000 (20:37 -0400)]
Merge: modelize: ask that attributes in refinements are either noautoninit or have a value
Without value, attributes in introductions does not have the same semantic that attributes in refinements
In introduction attributes are implicitly `autoinit`, in refinements they are `noautoinit`.
This is not POLA since
* this confuse beginners
* readers have to remember if they are in an intro or a refinement
* aditionnal cognitive fragility in constructors (more cases and rules to take in account)
This PR make `autoinit` the default and ask that attributes declared in refinement are either annotated `noautoinit` or have a default value.
This way, the writer has to think about the implication of adding a new attributes in existing classes, especially to think about their initialization. Thus this could help the programmer to avoid bad error.
For the moment, I just display a warning because I want to wait for feedback before doing a big migration (or doing nothing if people hate that), I also want to use jenkins to count and locate these new warnings.
Related to #1322
Pull-Request: #1411
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Sat, 30 May 2015 00:37:07 +0000 (20:37 -0400)]
Merge: Byte literals
As discussed in #1370, the `u8` suffix has been chosen for Byte literal values, this PR introduces it in the compiler
NOTE: Depends on #1403 for integration
Pull-Request: #1410
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 30 May 2015 00:37:01 +0000 (20:37 -0400)]
Merge: Byte data type
As discussed in #1267, we need a Byte data type to manipulate low-level data as numerics instead of how it is done for now using chars.
This PR will serve as base for future updates, notably related to #1370 which will introduce a way to express Bytes in their literal form.
Pull-Request: #1403
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 30 May 2015 00:36:52 +0000 (20:36 -0400)]
Merge: Serialization: change annotation to `serialize` and intro `noserialize`
The annotation `serialize` replaces `auto_serialize` and it is also more versatile. It can annotate a module so all its class definitions are serializable. It can also annotate an attribute so only this attribute is serialized.
The `noserialize` annotation is for exceptions to `serialize`. The most common case is to mark as non-serializable an attribute such as a password or a data blob.
Pull-Request: #1389
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Sat, 30 May 2015 00:36:43 +0000 (20:36 -0400)]
Merge: Introduction of convex polygons in geometry + benchmarks
Nit implementation of the convex polygon data structure.
It's based on the java implementation done during the data structures course.
There also are benchmarks for the Nit implementation and the Java implementation to compare them
Pull-Request: #1380
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Sat, 30 May 2015 00:36:30 +0000 (20:36 -0400)]
Merge: nitdoc: refactoring and cleaning
Now that nitx and nitdoc are fully merged with the same structure and services, we can start the refactoring to limit the differences between both tools.
Note that the first four commits are from #1401.
Demos from [Jenkins::CI-nitdoc](http://gresil.org/jenkins/job/CI-nitdoc):
* [Standard library](http://gresil.org/jenkins/job/CI-nitdoc/ws/doc/stdlib/index.html)
* [Nit compilers and tools](http://gresil.org/jenkins/job/CI-nitdoc/ws/doc/nitc/index.html)
Pull-Request: #1416
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Alexandre Terrasa [Thu, 28 May 2015 15:54:54 +0000 (11:54 -0400)]
nitdoc: fix typo in `doc_poset` comment
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 28 May 2015 15:54:30 +0000 (11:54 -0400)]
nitdoc: simplify DefinitionListArticle
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 28 May 2015 15:35:26 +0000 (11:35 -0400)]
nitdoc: remove useless class ImportationListSection
This class was used to customize the generation of this particular section and limit the diff with the original nitdoc output.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 28 May 2015 15:22:48 +0000 (11:22 -0400)]
nitdoc: remove useless class InheritanceListSection
This class was used to customize the generation of this particular section and limit the diff with the original nitdoc output.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 28 May 2015 15:18:49 +0000 (11:18 -0400)]
nitdoc: remove useless class IntrosRedefsSection
This class was used to customize the generation of this particular section and limit the diff with the original nitdoc output.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 28 May 2015 15:07:14 +0000 (11:07 -0400)]
nitdoc: fix typo in `DefinitionListArticle` comment
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 28 May 2015 15:06:56 +0000 (11:06 -0400)]
nitdoc: remove useless class ConstructorsSection
This class was used to customize the generation of this particular section and limit the diff with the original nitdoc output.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 28 May 2015 15:04:35 +0000 (11:04 -0400)]
nitdoc: remove useless class ProjectsSection
This class was used to customize the generation of this particular section and limit the diff with the original nitdoc output.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 26 May 2015 23:37:40 +0000 (19:37 -0400)]
nitdoc: factorize list article into `MEntitiesListArticle`
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 26 May 2015 23:25:40 +0000 (19:25 -0400)]
nitdoc: move `DocComposite::is_toc_hidden` to `doc_base`
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 26 May 2015 21:31:22 +0000 (17:31 -0400)]
nitdoc: introduce `DocComposite::is_hidden` services in `doc_base`
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 26 May 2015 21:04:00 +0000 (17:04 -0400)]
nitdoc: move `DocComposite::toc_title` in `doc_base`
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 22 May 2015 07:09:47 +0000 (03:09 -0400)]
nitdoc: introduce pretty printing of composite tree
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 29 May 2015 23:05:46 +0000 (19:05 -0400)]
nitdoc: move `DocComposite::title` to `doc_base`
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 26 May 2015 20:44:58 +0000 (16:44 -0400)]
nitdoc: replace `group:` prefix id by `.group` suffix
Because some HTML/JS tools do not like `:` in ids...
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 26 May 2015 20:43:33 +0000 (16:43 -0400)]
nitdoc: replace `concern:` prefix id by `.concern` suffix
Because some HTML/JS tools do not like `:` in ids...
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 26 May 2015 20:40:32 +0000 (16:40 -0400)]
nitdoc: replace `article:` prefix id by `.article` suffix
Because some HTML/JS tools do not like `:` in ids...
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 26 May 2015 20:30:32 +0000 (16:30 -0400)]
nitdoc: replace `section:` prefix id by `.section` suffix
Because some HTML/JS tools do not like `:` in ids...
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 29 May 2015 23:02:35 +0000 (19:02 -0400)]
nitdoc: move `DocComposite::id` to `doc_base`
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexis Laferrière [Fri, 29 May 2015 14:57:56 +0000 (10:57 -0400)]
tests: update serialization tests for nitg-e
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 10:29:32 +0000 (06:29 -0400)]
lib/serialization: update README with serialize scopes and with noserialize
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 01:16:23 +0000 (21:16 -0400)]
lib: update doc to refer to the `serialize` annotation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 01:15:53 +0000 (21:15 -0400)]
lib/a_star: update to use `serialize` instead of `auto_serializable`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 01:14:24 +0000 (21:14 -0400)]
lib/more_collections & bucketed_game: declare `serialize` at the module level
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 01:01:54 +0000 (21:01 -0400)]
tests: update expected results of deserialization tests
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 00:57:02 +0000 (20:57 -0400)]
tests: test double declaration of serialize on class defs
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 00:56:43 +0000 (20:56 -0400)]
tests: test `serialize` on attributes
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 00:56:10 +0000 (20:56 -0400)]
tests: test `noserialize` and `serialize` at different levels
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 00:52:20 +0000 (20:52 -0400)]
tests: test the `serialize` annotation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 00:51:56 +0000 (20:51 -0400)]
tests: test `noserialize` with the `lazy` annotation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 00:51:12 +0000 (20:51 -0400)]
lib/serialization: declare the `serialize` and the `noserialize` annotations
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 00:50:46 +0000 (20:50 -0400)]
src/serialization: redirect detection of the `serialize` annotation on AModule
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 00:49:16 +0000 (20:49 -0400)]
src/serialization: generate methods with per attribute serialization
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 00:47:05 +0000 (20:47 -0400)]
src/serialization: detect serialize from class, module and attributes
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 01:11:36 +0000 (21:11 -0400)]
src/serialization: detect incoherence in nested serialize annotations
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 00:43:42 +0000 (20:43 -0400)]
src/serialization: move adding the `Serializable` super class at the nclassdef
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 00:41:50 +0000 (20:41 -0400)]
src/serialization: detect more errors on serialize/noserialize annotations
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 00:41:02 +0000 (20:41 -0400)]
src/serialization: intro a service to detect the `noserialize` annotation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 24 May 2015 17:26:26 +0000 (13:26 -0400)]
src/serialization: intro a service to detect the `serialize` annotation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Fri, 29 May 2015 16:23:21 +0000 (12:23 -0400)]
lib/standard: remove the only `attr-in-refinement` warning
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 29 May 2015 16:21:13 +0000 (12:21 -0400)]
modelize: ask that attributes in refinements are either noautoninit or have a value
Signed-off-by: Jean Privat <jean@pryen.org>
Lucas Bajolet [Wed, 27 May 2015 17:21:40 +0000 (13:21 -0400)]
tests: Updated test for byte literals
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Wed, 27 May 2015 17:39:38 +0000 (13:39 -0400)]
compiler: Updated toolchain for proper byte literal support
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Wed, 27 May 2015 17:20:49 +0000 (13:20 -0400)]
parser: Regenerated for u8 suffix support
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Wed, 27 May 2015 17:20:21 +0000 (13:20 -0400)]
parser: Added u8 suffix for byte literal values
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 29 May 2015 14:07:31 +0000 (10:07 -0400)]
tests: Added test for Byte data type
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Tue, 26 May 2015 20:36:07 +0000 (16:36 -0400)]
lib/standard: Introduce Byte type in kernel
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Alexis Laferrière [Sun, 24 May 2015 21:41:36 +0000 (17:41 -0400)]
src/nitserial: do not use private classes when invisible
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Fri, 29 May 2015 01:49:02 +0000 (21:49 -0400)]
Merge: introduce plain_to_s
In order to have a more POLA `to_s` on collections, it is required that a new method with the old behavior is provided for clients that need it (especially the interpreter that use it for superstrings).
the compiler use `native_to_s` for superstrings but `c_src/nitg` still use `to_s` on array, so a regeneration of the bootstrap is required before changing the behavior of `to_s` on collections.
Pull-Request: #1385
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Blondin Massé <alexandre.blondin.masse@gmail.com>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Thu, 28 May 2015 00:21:23 +0000 (20:21 -0400)]
tests: update sav/nitserial_args1.res because change in RTA
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 24 May 2015 02:32:39 +0000 (22:32 -0400)]
lib/standard/string: introduce (an use) `plain_to_s`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 29 May 2015 01:40:09 +0000 (21:40 -0400)]
Merge: Nitg-g new NativeArray fix
This is a bug that was discovered during the push of #1403.
What happens is that since NativeArrays work only with boxed values, the copy_to operation could write data beyond its intended boundaries, hence corrupting random memory.
If you execute the test bundled with the PR, on my machine, with `--hardening` on, you get this error:
`BTD BUG: Dynamic type is Sys, static type is Array[Byte]`
What happens here is that the `dest` of the `memmove` was in a emplacement before the `Array[Byte]` itself, due to its length and because the `memmove` used val* as sizeof value, it rewrote the classid of `self`, hence changing its dynamic type effectively from `Array[Byte]` to `Sys`, which produces the typing bug.
If left too long to execute, or in an unlucky memory layout, it simply segfaulted.
The behaviour of NEW_NativeArray henceforth is that it will reserve space for n `val*` instead of the `ctype` of the values.
Pull-Request: #1417
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Jean Privat [Fri, 29 May 2015 01:38:43 +0000 (21:38 -0400)]
Merge: Annotation lateinit
#857 introduced `autoinit` on attributes that has a default value to initialize them latter.
This is a rarely used feature. It is also not POLA because it overloads the name `autoinit` that has a different meaning on methods cf #1308.
Thus in order to polaize the spec, the annotation is renamed `lateinit`. So close #1308.
Note: maybe the annotation will just be removed in a future PR, this one is a last attempt to keep it.
Related to #1322; required by #1311
Pull-Request: #1409
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Jean Privat [Fri, 29 May 2015 01:38:22 +0000 (21:38 -0400)]
Merge: Advice on useless repeated types
With this PR, nitpick and other tools are able to suggest to remove useless types in signature redefinition with the option `-W`.
Example:
~~~nit
class A
fun foo(a: Bool) do end
end
class B
super A
redef fun foo(a: Bool) do end
end
~~~
~~~
$ nitc test.nit -W
test.nit:8,19--22: Warning: useless type repetition on parameter `a` for redefined method `foo` (useless-signature)
redef fun foo(a: Bool) do end
^
Errors: 0. Warnings: 1.
~~~
Pull-Request: #1373
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Lucas Bajolet [Thu, 28 May 2015 21:10:31 +0000 (17:10 -0400)]
tests: Basic test for the allocation of NativeArray with short native values
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Thu, 28 May 2015 21:09:27 +0000 (17:09 -0400)]
nitg-g: Fix allocation of NativeArray
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Alexandre Terrasa [Thu, 28 May 2015 20:22:03 +0000 (16:22 -0400)]
tests: fix tests with repeated types warnings
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Thu, 28 May 2015 20:14:33 +0000 (16:14 -0400)]
Merge: contrib/header_static: a cog in the toolchains to generate Objcwrapper
### Filters preprocessed C-like header files to remove static code and keep their signatures.
This tool is used in the process of parsing header files to extract
information on the declared services (the functions and structures).
This information is then used to generate bindings for Nit code
to access these services.
The C header sometimes contains static code. It deletes static code of
headers, but keep their signatures. This tool is an extension of
header_keeper. It searches the keyword static to identify
the static code, and ignore the code into their brackets. The result is
printed to sdtout.
~~~sh
cat Pre-Processed/CGGeometry.h | header_static Pre-Processed/CGGeometry.h > Pre-Processed/static_header.h
~~~
This module can also be used as a library.
The main service is the method `header_static`
Pull-Request: #1396
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Thu, 28 May 2015 20:14:28 +0000 (16:14 -0400)]
Merge: nitdoc: introduce useful services
Some services needed for next PRs
No diff to HTML output
Pull-Request: #1401
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Alexandre Terrasa [Thu, 21 May 2015 21:27:37 +0000 (17:27 -0400)]
lib/json: remove useless types
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 21 May 2015 21:27:30 +0000 (17:27 -0400)]
lib/nitcorn: remove useless types
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 21 May 2015 21:27:22 +0000 (17:27 -0400)]
lib/socket: remove useless types
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 21 May 2015 21:27:09 +0000 (17:27 -0400)]
lib/template: remove useless types
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 21 May 2015 21:26:57 +0000 (17:26 -0400)]
lib/string_experimentations: remove useless types
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 21 May 2015 21:25:41 +0000 (17:25 -0400)]
lib/curl: remove useless types
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 21 May 2015 21:25:33 +0000 (17:25 -0400)]
lib/sqlite: remove useless types
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 21 May 2015 21:25:20 +0000 (17:25 -0400)]
lib/geometry: remove useless types
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 26 May 2015 04:15:03 +0000 (00:15 -0400)]
lib/neo4j: remove useless types
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 26 May 2015 04:18:18 +0000 (00:18 -0400)]
lib/sax: remove useless types
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 28 May 2015 13:55:46 +0000 (09:55 -0400)]
lib/standard: remove useless repeated types in `standard`
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Mon, 25 May 2015 15:30:56 +0000 (11:30 -0400)]
tests: test advice for useless repeated type in redef
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Wed, 20 May 2015 00:30:36 +0000 (20:30 -0400)]
model: check useless repeated types in signatures
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Wed, 20 May 2015 00:30:05 +0000 (20:30 -0400)]
nitpick: fix a typo in comments
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 22 May 2015 01:39:03 +0000 (21:39 -0400)]
nitdoc: check multiple page with same id
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 14 May 2015 01:23:22 +0000 (21:23 -0400)]
nitdoc: introduce `Page::title` and `Page::id` in `doc_base`
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 14 May 2015 06:24:00 +0000 (02:24 -0400)]
nitdoc: introduce `mentities_by_namespace` lookup service in DocModel
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 26 May 2015 18:19:02 +0000 (14:19 -0400)]
nitdoc: introduce `mentities_by_name` lookup service in DocModel
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Thu, 28 May 2015 00:19:25 +0000 (20:19 -0400)]
Merge: Correct warn on noautoinit
Move the analysis of the class annotation `noautoinit` after the inheritance of initializers so the warning is correct, thus fixes #1350
The main commit is mainly moving the code in the same method.
Pull-Request: #1408
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Thu, 28 May 2015 00:19:17 +0000 (20:19 -0400)]
Merge: Rename the visit function of minilang example.
This PR rename the visit function of the ```minilang.nit``` file. The previous name was incoherent with the module purpose.
Pull-Request: #1406
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 28 May 2015 00:19:09 +0000 (20:19 -0400)]
Merge: Use self in the FFI
As requested by everyone, replace the id `recv` by `self` in all Nit FFIs, and their users.
This PR must be integrated before regenerating c_src and using the light FFI in bootstrap critical code.
There is a few commits to update the style of files that caused white space errors.
Pull-Request: #1399
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Jean-Philippe Caissy <jpcaissy@piji.ca>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Thu, 28 May 2015 00:19:00 +0000 (20:19 -0400)]
Merge: Improve internal mechanisms of the nitvm
This PR fixes a bug that was hidden in the nitvm for a too long time, the recursion in class loading was bad and is now corrected.
Then a more accurate mechanism is introduce to deal with positions of methods and attributes in internal structures of classes and objects.
When a method dispatch is performed, this mechanism allows to ask precisely for a class the position of a block of methods (or attributes). This should increase the proportion of object mechanisms "compiled" in an efficient way.
Finally, the class loading is optimized: an indirectly loaded class is not fully constructed and allocated.
Instead, its identifier is computed to allow subtyping tests.
For now, these more accurate mechanisms need recompilations of callsite. This sould be done in further PR.
Pull-Request: #1398
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Thu, 28 May 2015 00:18:53 +0000 (20:18 -0400)]
Merge: Markdown location
Introduce location in markdown parser so tools can easily retrieve the original position of a block or a token in the input file/string.
Commits:
* 2d139eb introduces de Location concept and update the parser
* fda150d isn't interesting since it only update signature in the test file
* dacc7ba adds some test suites for the locations
Pull-Request: #1397
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Thu, 28 May 2015 00:18:39 +0000 (20:18 -0400)]
Merge: contrib/header_static: a cog in the toolchains to generate Objcwrapper
### Filters preprocessed C-like header files to remove static code and keep their signatures.
This tool is used in the process of parsing header files to extract
information on the declared services (the functions and structures).
This information is then used to generate bindings for Nit code
to access these services.
The C header sometimes contains static code. It deletes static code of
headers, but keep their signatures. This tool is an extension of
header_keeper. It searches the keyword static to identify
the static code, and ignore the code into their brackets. The result is
printed to sdtout.
~~~sh
cat Pre-Processed/CGGeometry.h | header_static Pre-Processed/CGGeometry.h > Pre-Processed/static_header.h
~~~
This module can also be used as a library.
The main service is the method `header_static`
Pull-Request: #1396
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
BlackMinou [Fri, 22 May 2015 09:27:31 +0000 (11:27 +0200)]
Nit Convex Polygon benchmark code
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
BlackMinou [Fri, 22 May 2015 09:26:56 +0000 (11:26 +0200)]
Nit Convex Polygon benchmark config files
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
BlackMinou [Fri, 22 May 2015 09:25:01 +0000 (11:25 +0200)]
Java Convex Polygon benchmark code
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
Signed-off-by: Djomanix <johan.kayser@viacesi.fr>
BlackMinou [Fri, 22 May 2015 09:24:15 +0000 (11:24 +0200)]
Java Convex polygons benchmark config files
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
BlackMinou [Fri, 22 May 2015 09:22:27 +0000 (11:22 +0200)]
Convex polygon benchmark folder
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
BlackMinou [Fri, 22 May 2015 09:21:28 +0000 (11:21 +0200)]
Introduce polygon module
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
Jean Privat [Wed, 27 May 2015 16:56:12 +0000 (12:56 -0400)]
tests: update tests for lateinit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 27 May 2015 16:55:50 +0000 (12:55 -0400)]
modelize: rename annotation `autoinit` on attributes as `lateinit`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 27 May 2015 15:52:51 +0000 (11:52 -0400)]
tests: add alt to base_init_autoinit3 to check warning on `noautoinit`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 27 May 2015 15:51:53 +0000 (11:51 -0400)]
modelize: `noautoinit` check inherited initializes before warning
Signed-off-by: Jean Privat <jean@pryen.org>
Arthur Delamare [Mon, 25 May 2015 20:04:18 +0000 (16:04 -0400)]
contrib/header_static: a cog in the toolchains to generate ObjCwrapper
Signed-off-by: Arthur Delamare <arthur.delamare@viacesi.fr>