Lucas Bajolet [Mon, 1 Jun 2015 18:03:56 +0000 (14:03 -0400)]
compiler: Changed types of Char to uint32_t and NativeString to unsigned char*
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Sat, 30 May 2015 12:15:42 +0000 (08:15 -0400)]
Merge: Kill `model_utils`
This PR removes the so hated module `model_utils`:
* Useful services are kept in a new module `model::model_collect` that allows to collect and filter things from a `Model`.
* Clients are migrated from `model_utils` to `model_collect` one by one. Misc functionalities used only by one client are moved in the client.
Fixes #710
Pull-Request: #1376
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Sat, 30 May 2015 00:37:42 +0000 (20:37 -0400)]
Merge: Fix reading from Sockets
Pull-Request: #1418
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 30 May 2015 00:37:30 +0000 (20:37 -0400)]
Merge: Clean nit compilation directory
This PR cause the compilation directory to be removed after compilation.
This auto-removal is disabled if `--compile-dir` or `--no-cc` is used because it is a sane default I think.
Moreover, the compilation directory is renamed by defaut to `nit_compile` because there is no more point to make it hidden since its presence means an active request (`--no-cc`).
The PR is a bit premature since the boostrap will fail since `rmdir` requires the light FFI, so it is planned to be merged after the regen of c_src.
Close #792
Pull-Request: #1415
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Sat, 30 May 2015 00:37:22 +0000 (20:37 -0400)]
Merge: Warn call on nullable receiver
Followup of #1375 and #394
This introduce an advice on calls on a nullable receiver.
Since the conversion could be complex, I propose a light approach with advices (quiet warnings) instead of hard errors, so that:
1. jenkins can track them
2. nitpick (thus vim) can show them
3. mirgration can be done in an incremental and iterative way
4. issues with a strict call-on-nullable policy can be identified without breaking things
5. @Morriar can bank nitcoins in future PR
If (when?) all call on nullable can be removed, then the advice will become an error.
Pull-Request: #1414
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
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 [Mon, 25 May 2015 20:56:03 +0000 (16:56 -0400)]
tests: fix tests for nitmetrics
Because the imported modules changed, the linearizations of the metrics phases changed and informations are not displayed in the same order.
Also, using the new framework, more classes are discovered, this is why the MENDEL values are slightly different.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Mon, 25 May 2015 15:40:22 +0000 (11:40 -0400)]
tests: fix tests for nituml
Old model_utils did not listed the init methods, the new model_collect does that.
So I fixed the correct result in the tests.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 22 May 2015 00:26:40 +0000 (20:26 -0400)]
src: remove unused module `model_utils`
Fixes #710
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 22 May 2015 00:26:08 +0000 (20:26 -0400)]
nitdoc: migrate to `model_collect`
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 22 May 2015 00:25:51 +0000 (20:25 -0400)]
vim_autocomplete: migrate to `model_collect`
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 22 May 2015 00:25:25 +0000 (20:25 -0400)]
nitmetrics: migrate to `model_utils`
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 22 May 2015 00:24:47 +0000 (20:24 -0400)]
nitserial: remove dependency to `model_utils`
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 22 May 2015 00:23:52 +0000 (20:23 -0400)]
test_neo: migrate to `model_collect`
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 22 May 2015 00:23:34 +0000 (20:23 -0400)]
uml: remove useless repeated type in redef
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 22 May 2015 00:23:13 +0000 (20:23 -0400)]
uml: migrate to `model_collect`
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Mon, 25 May 2015 15:44:56 +0000 (11:44 -0400)]
model: introduce `model_collect` to collect and filter things from a `Model`
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 21 May 2015 22:32:27 +0000 (18:32 -0400)]
model_utils: move shortcuts to `MClassKind` in `model`
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 21 May 2015 22:22:29 +0000 (18:22 -0400)]
model_utils: move `MEntityNameSorter` to `model_base`.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 21 May 2015 22:00:14 +0000 (18:00 -0400)]
model_utils: remove unused method `imported_mclasses`
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Thu, 21 May 2015 21:55:15 +0000 (17:55 -0400)]
model_utils: remove unused `in_nesting_*` methods
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 26 May 2015 15:57:22 +0000 (11:57 -0400)]
model_utils: move concerns ranking to doc/
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
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>
Alexis Laferrière [Fri, 29 May 2015 16:39:06 +0000 (12:39 -0400)]
lib/socket: fix call to enlarge with actual buffer usage
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 14:48:42 +0000 (10:48 -0400)]
lib/socket: support reading string with null bytes
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 29 May 2015 16:29:50 +0000 (12:29 -0400)]
lib/socket: fix enlarge buffer when size is at 0
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>
Jean Privat [Fri, 29 May 2015 14:39:09 +0000 (10:39 -0400)]
bootstrap: active cleaning of remaining useless files
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 29 May 2015 02:06:10 +0000 (22:06 -0400)]
tests: compile dir is `nit_compile`, and cleannit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 29 May 2015 02:04:54 +0000 (22:04 -0400)]
Makefile&gitignore: remove .nit_compile
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 29 May 2015 02:04:03 +0000 (22:04 -0400)]
src: remove remaining references to .nit_compile
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 28 May 2015 15:17:24 +0000 (11:17 -0400)]
man: document compilation directory for nitc
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>
Jean Privat [Thu, 28 May 2015 15:08:46 +0000 (11:08 -0400)]
compiler: remove the compilation directory unless explicitely set
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 29 May 2015 14:31:48 +0000 (10:31 -0400)]
abstract_compiler: introduce root_compile_dir for platforms that need them
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 29 May 2015 14:21:32 +0000 (10:21 -0400)]
abstract_compiler: attach compiler and toolchain
The role of the Compiler is to know how to compile Nit programs in C.
The role of the Toolchain is to know where to save C file and how to compile them
Signed-off-by: Jean Privat <jean@pryen.org>
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 13:02:19 +0000 (09:02 -0400)]
tests: update error messages on exact call on null
Signed-off-by: Jean Privat <jean@pryen.org>
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>
Jean Privat [Thu, 28 May 2015 14:27:01 +0000 (10:27 -0400)]
compiler: rename compilation dir as `nit_compile`
Signed-off-by: Jean Privat <jean@pryen.org>
fix rename
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>