Jean Privat [Sat, 18 Apr 2015 14:49:32 +0000 (21:49 +0700)]
neo: save MParameter::is_default
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 18 Apr 2015 13:40:26 +0000 (20:40 +0700)]
typing&engines: implement default arguments
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 16 Apr 2015 11:11:09 +0000 (18:11 +0700)]
model&modelize: introduce default parameters
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 18 Apr 2015 09:47:34 +0000 (16:47 +0700)]
Merge: Snake phase names
Default name of phases where based on a lower cased version of their classnames.
That was bad. eg `FFILanguageAssignationPhase` -> `ffilanguageassignation`
So this PR snakecase them instead.
But the spec of `to_snake_case` was awful: `f_f_i_language_assignation`
So also fix the spec of this method and get something nice `ffi_language_assignation`.
Pull-Request: #1276
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Sat, 18 Apr 2015 09:47:26 +0000 (16:47 +0700)]
Merge: Microbenches for niti
Some update on tests/ so that niti (and nitvm) can pass more tests
Pull-Request: #1275
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>
Jean Privat [Sat, 18 Apr 2015 09:47:17 +0000 (16:47 +0700)]
Merge: Autocast and literal arrays
Small bugfixes
* forbid autocasts in combined assignments and literal arrays
* keep autocast information in transform
* rta visits implicit methods of literal arrays
Only the first one was the original bug I wanted to fix, the two others where discovered and solved while writing the PR.
Pull-Request: #1272
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Jean Privat [Sat, 18 Apr 2015 09:47:09 +0000 (16:47 +0700)]
Merge: Option --keep-going
Follow up of #959 and #1241. Now an option is exposed so people can happily try to use it on various tools that will turn them berserk and make them want to kill you.
Pull-Request: #1270
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Jean Privat [Sat, 18 Apr 2015 09:47:00 +0000 (16:47 +0700)]
Merge: Check operator
Previously, no checking was done on the signature of operators.
While this is not an issue for the model nor the tools this could yield to not POLA error messages when the operator is used. eg.
~~~nit
class A
fun +(other: A) do print "hello"
end
var a = new A
var b = a + a # Error expected expression
a + a # Error unexpected operator +
# no way do invoke `+` in fact.
~~~
With the PR, we have
~~~
Error: mandatory return type for `+`.
fun +(other: A) do print "hello"
^
~~~
The following errors are added by the PR:
* mandatory return
* not enough parameters
* too much parameters
* illegal variadic parameter
Pull-Request: #1269
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>
Jean Privat [Sat, 18 Apr 2015 09:46:51 +0000 (16:46 +0700)]
Merge: Signature map
Provide an abstraction `SingatureMap` to factorize (and simplify) the association between arguments and parameters (not that easy in the context of varargs).
This PR is also required by a future PR.
Pull-Request: #1268
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>
Jean Privat [Thu, 16 Apr 2015 13:34:47 +0000 (20:34 +0700)]
tests: update test_ffi_c_operators for << and >>
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 16 Apr 2015 11:04:11 +0000 (18:04 +0700)]
tests: add error_operators.nit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 16 Apr 2015 11:01:11 +0000 (18:01 +0700)]
modelize_property: implement special validity rules for operators
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 18 Apr 2015 09:36:31 +0000 (16:36 +0700)]
tests: update test_new_native.res because line change in array.nit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 16 Apr 2015 09:57:27 +0000 (16:57 +0700)]
interpreter: use SignatureMap to make varargize more robust
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 16 Apr 2015 09:55:39 +0000 (16:55 +0700)]
compiler: use SignatureMap to make varargize more robust
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 17 Apr 2015 15:54:39 +0000 (22:54 +0700)]
lib/standard/array: add `Array::sub`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 17 Apr 2015 07:25:35 +0000 (14:25 +0700)]
phases: default names is the snake_cased version of the classname
use `nitc --disable-phase list` to see them
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 17 Apr 2015 07:24:39 +0000 (14:24 +0700)]
strings: reimplement to_snake_case with a correct semantic
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 17 Apr 2015 08:11:02 +0000 (15:11 +0700)]
tests: add output for benchs that does not have some
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 17 Apr 2015 06:59:28 +0000 (13:59 +0700)]
update niti.skip and nitvm.skip to allow more tests (including benches)
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 17 Apr 2015 06:47:22 +0000 (13:47 +0700)]
tests: update benchs*.nit to have a common default time and an non-linear grow
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 17 Apr 2015 00:45:32 +0000 (07:45 +0700)]
tests: add base_autocast_array.nit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 17 Apr 2015 01:06:35 +0000 (08:06 +0700)]
lib/string_search: avoid covariant array on `split_once_on`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 16 Apr 2015 16:33:13 +0000 (23:33 +0700)]
transform: do not lose autocast information
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 16 Apr 2015 16:32:54 +0000 (23:32 +0700)]
rta: visit implicit methods of literal arrays
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 16 Apr 2015 16:00:17 +0000 (23:00 +0700)]
tests: update sav/test_toolcontext* because of the new option
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 16 Apr 2015 15:50:30 +0000 (22:50 +0700)]
metrics/detect_covariance: update check_subtype
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 16 Apr 2015 15:50:01 +0000 (22:50 +0700)]
typing: do not autocast on arrays or combined assignment
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 16 Apr 2015 15:04:04 +0000 (22:04 +0700)]
man: add --keep-going
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 16 Apr 2015 14:40:13 +0000 (21:40 +0700)]
toolcontext: add --keep-going to keep going
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 16 Apr 2015 08:37:41 +0000 (15:37 +0700)]
typing: introduce SignatureMap to factorize parameters<->arguments mapping work
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 16 Apr 2015 04:13:24 +0000 (11:13 +0700)]
Merge: Extends operators
* Add missing combined assignments: `*=`, `/=`, `%=`, `**=`, `<<=`, `>>=`
* Add missing unary + operator (why?)
* Keep operators in the AST for better messages
* Factorize some information in the AST to simplify code in other modules
Pull-Request: #1263
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Wed, 15 Apr 2015 05:40:32 +0000 (12:40 +0700)]
tests: update other sav for new AST of location in error messages
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Apr 2015 05:39:56 +0000 (12:39 +0700)]
tests: extends base_combined_assignment and test_ffi_c_operators
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Apr 2015 05:36:24 +0000 (12:36 +0700)]
lib/stc/kernel: add << and >> in Int
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Apr 2015 05:37:17 +0000 (12:37 +0700)]
nitpretty: handle AUplusExpr and simplify binary operations
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Apr 2015 05:38:55 +0000 (12:38 +0700)]
typing: use new `operator` and `n_op` from ABinopExpr and AAssignOp
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Apr 2015 05:00:13 +0000 (12:00 +0700)]
src: implement unary plus
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Apr 2015 04:50:36 +0000 (11:50 +0700)]
parser: regenerate
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Apr 2015 03:50:33 +0000 (10:50 +0700)]
grammar: add more combined assignment operator
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Apr 2015 04:49:59 +0000 (11:49 +0700)]
grammar: introduce n_op and operator in AAssignOp
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Apr 2015 04:48:42 +0000 (11:48 +0700)]
parser: add ABinopExpr::operator to avoid refining each operator class in other modules
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Apr 2015 04:09:18 +0000 (11:09 +0700)]
grammar: keep operators in the AST for better messages
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Apr 2015 03:53:38 +0000 (10:53 +0700)]
grammar: as unary plus operation (only for thr sake on completion)
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Apr 2015 03:34:16 +0000 (10:34 +0700)]
Merge: Review errors messages
A big PR but that just review the errors and warning messages printed by the tools.
I tries to follow a standard format:
eg. "Error: cannot find method `foo`."
* start with a message type like "Error:", "Syntax Error:", "Warning:".
The type is capitalized and terminated by a column.
The rest on the message starts with a lowercase letter and is terminated with a dot.
* be short and fit on a single line.
* have meaningful information first.
This helps the reader and remain usable
when truncated, by an IDE for instance.
* enclose identifiers, keywords and pieces of code with back-quotes.
Do not hesitate no nitpick phrasing or wording or propose better messages.
Close #931
Pull-Request: #1253
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Wed, 15 Apr 2015 03:34:05 +0000 (10:34 +0700)]
Merge: Check contrib
Add a script `misc/jenkins/check_contrib.sh` to automatically compile and tests things in contrib and examples.
New (and existing) programs in these directory should try to add some basic (or extensive) checking.
Note that I used the name `check` that is the standard name for Makefiles (`tests` seems to be an invention of myself) http://www.gnu.org/software/make/manual/make.html#Standard-Targets
Pull-Request: #1259
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Wed, 15 Apr 2015 03:33:59 +0000 (10:33 +0700)]
Merge: tests: add --autosav to automatically update the sav directory.
Advantages:
* avoid manual error-prone update (especially on large tests)
* diffs on the sav/ files may be easier to see with git tools
Drawbacks:
* the wrong sav dir can by used for specific engines/uname/etc.
* manual inspection still required
Is used for #1253 because manual updates are a PITA
Pull-Request: #1258
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Fri, 10 Apr 2015 15:44:46 +0000 (22:44 +0700)]
tests: update sav with new error messages
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Apr 2015 01:14:56 +0000 (08:14 +0700)]
src: improve messages (and sometime location) of errors and warnings
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 14 Apr 2015 10:07:29 +0000 (17:07 +0700)]
model: add `MClass::signature_to_s` to use in messages.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 9 Apr 2015 12:40:28 +0000 (19:40 +0700)]
typing: identify the node associated to method name
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 14 Apr 2015 11:57:37 +0000 (18:57 +0700)]
contrib: add some check rules
`check` is the expected name for Makefile, `tests` is a nitism
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 14 Apr 2015 11:56:44 +0000 (18:56 +0700)]
jenkins: add check_contrib.sh to automatically compile and check contribs
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 14 Apr 2015 11:11:11 +0000 (18:11 +0700)]
tests: add --autosav to automatically update the sav directory.
Advantages:
* avoid manual error-prone update (especially on large tests)
* diffs on the sav/ files may be easier to see with git tools
Drawbacks:
* the wrong sav dir can by used for specific engines/uname/etc.
* manual inspection still required
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 14 Apr 2015 09:33:40 +0000 (16:33 +0700)]
Merge: Fix type adaptation when there is loops
Basically one of the oldest bug of Nit.
The point of adaptive typing is that the static types of variables follows the static types of the assigned values, type tests and comparison to null.
This is a great feature of the language but was buggy because loops where not taken in account (old TODO), until the present PR.
The basic idea is just to track if a type adaptation occurs, if yes replay the whole typing phase.
The immediate drawback is that now typing require 2 passes most of the time, and sometime more.
This PR was a roller-coaster of emotions to develop since a lot a surprise issues were discovered.
* bug in flow that give me hours of despair.
* duplication of error messages; because multiple passes.
* premature warning/error messages; because some error conditions on types are detected at the first pass but a second pass find it is fine in fact... but too late the error message was printed.
* almost work at the first time (modulo the previous issues)
* only two bugs found in the whole code, quite impressive, and one of them is not a real bug but an autocast issue.
The issue about error duplication and premature errors is only workadounded (or fixme) in most places.
But proper solutions will be required in future PR.
close #647 and close #86, then reopen it again, then reclose it.
Pull-Request: #1257
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Tue, 14 Apr 2015 09:33:32 +0000 (16:33 +0700)]
Merge: Intern new
A small short PR that enables a `new`-factory to instantiate itself.
previously there was no way to do that. The following code will stack-overflow:
~~~nit
class A
new do
var res = new A
res.do_thigns
return res
end
end
var a = new A # infinite recursion of `new A`
~~~
Note: this is a very bad example as what is done in the previous `new` should be done in an `init` instead since it is related to the initialization of the object. A `new` factory should be exclusively used for some factory-concern like returning a more specialized object or returning an already existing object.
With this PR, the primitive constructor is available and is called `intern`, as the annotation that indicates things that cannot be programmed in Nit but are provided by the execution engine.
So in the previous example, just use this primitive constructor instead of doing a recursive call:
~~~
var res = new A.intern
~~~
This intern constructor just do the allocation and the initialization of attributes with default values.
`init` is not called.
Maybe it should not do the initialization of attributes neither but if I skip them, there is no way for the programmer to ask for them manually. whereas `init` in not automatically called but can be called manually.
note: this PR is a small step toward the conclusion of the constructor saga, more will come soon (I hope)
Pull-Request: #1252
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Tue, 14 Apr 2015 09:33:22 +0000 (16:33 +0700)]
Merge: Improved parallelization phase
The "threaded" annotation now supports functions with parameters !
Still need to check for eventual self calls in the body of the annotated function
Pull-Request: #1255
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
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, 14 Apr 2015 09:32:55 +0000 (16:32 +0700)]
Merge: Make the generated iOS project compilable in the XCode GUI
I originally incorporated the test project in the generated XCode workspace thinking that we could use it somehow. But it duplicates services from nitunits and it would be much more complex to use.
I remove the test project now because it is incomplete and raise errors from the XCode GUI.
Pull-Request: #1254
Reviewed-by: ArthurDelamare <arthur.delamare@viacesi.fr>
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, 14 Apr 2015 09:32:40 +0000 (16:32 +0700)]
Merge: Vim plugin fixes and make Nitdoc a command with search capabilities
You can now use Nitdoc as a command in Vim.
* Search the doc for the word under the cursor with `:Nitdoc`
* Display the doc of the `String` class (followed by all docs using the word "String", case-insensitive) with `:Nitdoc String`
* Display the doc of `Int::%` with `:Nitdoc modulo`
* Search for a string of words (in the given order) with `:Nitdoc not null`
Some query can produce quite a lot results. `:Nitdoc the` will fill the preview window with 33 379 lines of doc, but there no noticeable delay.
### Bonus tip!
Navigate in the doc by moving the cursor above a word in the preview window and using ctrl-D (or `:Nitdoc`), exactly as you would do in Nit code.
Pull-Request: #1256
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Sun, 12 Apr 2015 04:14:58 +0000 (11:14 +0700)]
tests: add base_adaptive_loop*.nit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Apr 2015 17:14:40 +0000 (00:14 +0700)]
tests: update sav for existing tests
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Apr 2015 17:13:56 +0000 (00:13 +0700)]
toolcontext: avoid duplicated messages
This is just a workaround to limit repeated errors message because of
adapting typing
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Apr 2015 17:12:50 +0000 (00:12 +0700)]
lib/ai/backtrack: add a missing assert
or else the possible null will loop and cause errors.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Apr 2015 17:11:40 +0000 (00:11 +0700)]
lib/a_star: avoid bad autocast
Seriously, this one case might be a strong argument against autocasts
~~~
frontier_node = frontier_node.best_source.as(not null)
~~~
is auto-casted as
~~~
frontier_node = frontier_node.best_source.as(not null).as(N)
~~~
bun since the N is `nullable Node`, the not-null information was lost in the
cast.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 12 Apr 2015 04:13:24 +0000 (11:13 +0700)]
compiler: consider untyped expressions and statement as dead code
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Apr 2015 17:09:04 +0000 (00:09 +0700)]
typing: handle `a == null` when `a` is null
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Apr 2015 17:07:41 +0000 (00:07 +0700)]
typing: shortcut `get_variable` on never-adapted variables
Signed-off-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Mon, 13 Apr 2015 03:52:34 +0000 (23:52 -0400)]
misc/vim: inform the user when no results are found
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 11 Apr 2015 14:21:51 +0000 (10:21 -0400)]
misc/vim: update README file
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Sat, 11 Apr 2015 17:06:45 +0000 (00:06 +0700)]
typing: ensure monotony on literal arrays
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Apr 2015 17:06:06 +0000 (00:06 +0700)]
typing: revisit on type-adaptation, until there is no more adaptation
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Apr 2015 17:04:16 +0000 (00:04 +0700)]
typing: mark variable dirty on type_adaptation
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Apr 2015 17:00:09 +0000 (00:00 +0700)]
typing: compute FlowContext::collect_types without recursion
So this avoid infinite recursion on loops
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Apr 2015 16:55:07 +0000 (23:55 +0700)]
typing: remove cache in FlowContext
Because type adaptation require recomputation on loops
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Apr 2015 16:52:46 +0000 (23:52 +0700)]
flow: improve dot-rendering for debugging
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Apr 2015 16:52:01 +0000 (23:52 +0700)]
flow: fix loop links on continue
Targets the begin of the block
Signed-off-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Sat, 11 Apr 2015 14:32:45 +0000 (10:32 -0400)]
misc/vim: delete the first empty line of the preview window on Nitdoc command
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 11 Apr 2015 14:12:30 +0000 (10:12 -0400)]
misc/vim: the Nitdoc command search with priorities
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 11 Apr 2015 13:41:21 +0000 (09:41 -0400)]
misc/vim: make Nitdoc a command
Use this vim command to show the doc of any entities `:Nitdoc Object`.
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 11 Apr 2015 14:11:00 +0000 (10:11 -0400)]
misc/vim: fix omnifunc order of results found in the long doc
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 11 Apr 2015 14:10:15 +0000 (10:10 -0400)]
misc/vim: make private functions local to the script
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 10 Apr 2015 19:09:29 +0000 (15:09 -0400)]
nitc/ios: use a camel case version of app namespace for some version of XCode
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 10 Apr 2015 17:21:10 +0000 (13:21 -0400)]
nitc/ios: remove all testing related entities from the xcode project
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Fri, 10 Apr 2015 15:19:40 +0000 (22:19 +0700)]
Merge: Sys is top
And when I say *top* I mean *great*. But I also mean *top* in fact.
The idea is to move the top-level methods (those defined outside classes) from Object to Sys.
While this is a cosmetic move, it has a lot of benefits:
* top-level methods get a real meaningful receiver: the current system. It is meaningful both on the declaration side and the call side.
* no more need to distinguish the concept of top-level methods with their rules and semantic, so this simplify the language with one less thing (almost, see bellow)
* self is now usable in top-level methods, not that useful now because it is `sys`, a singleton, but this allow some kind of inheritance if you add super-classes to Sys.
* no more name conflicts between a standard class method and a top-level method
* no more useless slots in table of classes for crazy methods defined in Object and never redefined
* close #461 and close #1081 by making them irrelevant
* Let us see a bright future where the singleton Sys become a multiton and allow specific isolation of computation. Specific Sys will then be active objects (threads, computation node, actors, whatever) isolated with their own specific cloud of objects and efficient lock-less concurrency, dedicated memory model (realtime?), and why not transparent distribution
There is still two drawbacks
* what is the status of `sys` that represent the current `Sys`? I hard-coded it to stay a method in Object. One way to solve the probem is to make it a keyword (like `self`)
* when doing `foo(x)`, first this tries `self.foo(x)` then `sys.foo(x)` thus this is some additional rule of the language.
Pull-Request: #1249
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Fri, 10 Apr 2015 11:27:53 +0000 (18:27 +0700)]
Merge: Robust IO
Some cleanup on lib/standard/file.nit
Especially close #755
There is still some work to do and question to answer from an API point of view.
Pull-Request: #1246
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Fri, 10 Apr 2015 11:27:45 +0000 (18:27 +0700)]
Merge: miniclean quadtrees
Still a lot of warning remains...
Pull-Request: #1251
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Fri, 10 Apr 2015 10:31:17 +0000 (17:31 +0700)]
tests: remove fixme sav/nitg-g/fixme/test_deriving_alt1.res
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 8 Apr 2015 13:53:37 +0000 (20:53 +0700)]
tests: ffi use `Sys_` instead of `Object_` prefix
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 8 Apr 2015 13:53:03 +0000 (20:53 +0700)]
tests: update tests results related to top-level or Object->Sys
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 8 Apr 2015 15:51:44 +0000 (22:51 +0700)]
code: remove `protected` from top-level methods (now in sys)
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 8 Apr 2015 13:51:31 +0000 (20:51 +0700)]
typing: remove most top-level things
only kept for `new` factories and `sys` (for the moment)
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 8 Apr 2015 13:50:04 +0000 (20:50 +0700)]
lib/md5: do not import `print` in FFI
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 8 Apr 2015 13:15:03 +0000 (20:15 +0700)]
mixin: look for top-level methods in `Sys`.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 8 Apr 2015 13:14:19 +0000 (20:14 +0700)]
modelize_classes: top-level methods are defined in Sys, not Object
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 8 Apr 2015 13:11:35 +0000 (20:11 +0700)]
engines: implement special fall-back to sys
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 8 Apr 2015 13:10:54 +0000 (20:10 +0700)]
typing: look for method in `sys` when they are not in `self`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 8 Apr 2015 10:18:00 +0000 (17:18 +0700)]
modelize classes: process AStdClassdef before
So that non-AStdClassdef classes can be attached to existing ones if any
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 10 Apr 2015 10:09:18 +0000 (17:09 +0700)]
niti: implements native `chdir` and `mkdir` with a return value
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 10 Apr 2015 05:20:58 +0000 (12:20 +0700)]
tests: add base_new_intern.nit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 10 Apr 2015 05:16:03 +0000 (12:16 +0700)]
typing: `intern` is used to refer to the plain vanilla constructor
It is used to implement specific factories inside classes
~~~
class A
new do
var res = new A.intern
res.do_things
return res
end
end
~~~
Signed-off-by: Jean Privat <jean@pryen.org>