Jean-Christophe Beaupré [Wed, 29 Oct 2014 16:10:42 +0000 (12:10 -0400)]
neo4j: Implement missing methods in `JsonArray`.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Alexis Laferrière [Sun, 26 Oct 2014 16:21:22 +0000 (12:21 -0400)]
lib/threads: optional redefs of collections to be thread-safe
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 26 Oct 2014 16:19:31 +0000 (12:19 -0400)]
lib/threads: intro of the threads lib, with Thread, Mutex and Barrier
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Wed, 29 Oct 2014 13:27:33 +0000 (09:27 -0400)]
highlight: fix css for line and foldable
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 29 Oct 2014 13:05:01 +0000 (09:05 -0400)]
nitlight: disable `cached` since transformed AST cause issues in highlight
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 29 Oct 2014 12:52:06 +0000 (08:52 -0400)]
auto_super_init: make code robust if `typing` is disabled
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 29 Oct 2014 12:50:54 +0000 (08:50 -0400)]
phase: make `disabled=` public
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 29 Oct 2014 01:32:53 +0000 (21:32 -0400)]
lib: fix semantic on has_substring on extreme cases
And avoid illegal access outside the string.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 29 Oct 2014 00:11:46 +0000 (20:11 -0400)]
Merge: Opportunity
Addresses a few issues mentionned in #811 :
- Return to the meetup creation page when the creation fails (auto-complete fields with old info)
- Use real buttons for the addition/deletion of an attendee to a Meetup
- Forbid creation of a Meetup without at least one answer
I also added feedback when an error is produced when creating the Meetup via a system similar to what @xymus does for Benitlux.
There were a few bugs hidden in the code, the update of the compiler with checks on useless null tests has revealed two of them.
Pull-Request: #850
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Wed, 29 Oct 2014 00:11:43 +0000 (20:11 -0400)]
Merge: example: rosetta code
Starting playing #842
It is zen...
Pull-Request: #844
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Wed, 29 Oct 2014 00:11:40 +0000 (20:11 -0400)]
Merge: xml: Introduce SAXophoNit, a SAX processor in Nit.
This is a work in progress for a SAX processor in Nit.
Here is a sumary of what is (and what is not) supported at this point:
- [X] Content
- [X] XML declaration (parse it)
- [X] Acceptation of any XML document that Doxygen generates
- [ ] `DOCTYPE` declaration (or ignore it)
- [ ] XML declaration (do something with the settings)
- [x] Namespaces in XML
- [x] SAX mandatory feature flags
- [ ] XML 1.1
- [ ] Ignorable white space
- [ ] User-defined entities
- [ ] Encodings
- [ ] URIs
- [x] Test suite
Pull-Request: #802
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Tue, 28 Oct 2014 18:38:57 +0000 (14:38 -0400)]
opportunity: Fixed a few typos.
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Tue, 28 Oct 2014 00:30:34 +0000 (20:30 -0400)]
Merge: grammar: allow '`' inside foreign code blocks
This was an old bug causing the use of ``` ` ``` within a foreign code block to break the block. Example:
~~~~
fun foo `{
// Some comment on entity `foo` would prevent the whole block to be recognize
`}
~~~~
Pull-Request: #847
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 27 Oct 2014 19:44:05 +0000 (15:44 -0400)]
example: add some tasks of Rosetta code
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 27 Oct 2014 23:53:58 +0000 (19:53 -0400)]
tests: update test_new_native_alt1 becaus eline change in array.nit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 27 Oct 2014 19:38:30 +0000 (15:38 -0400)]
lib: add Array::+
Signed-off-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Sun, 26 Oct 2014 13:12:59 +0000 (09:12 -0400)]
lib/collection: minor fix to doc in list.nit
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Lucas Bajolet [Mon, 27 Oct 2014 18:50:25 +0000 (14:50 -0400)]
opportunity: Bugfix for answers at creation of a new attendee for a Meetup
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Mon, 27 Oct 2014 18:05:17 +0000 (14:05 -0400)]
opportunity: Cosmetic changes to meetup visualization page
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Mon, 27 Oct 2014 17:21:30 +0000 (13:21 -0400)]
opportunity: Fixed useless null check
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Mon, 27 Oct 2014 17:21:15 +0000 (13:21 -0400)]
opportunity: Creation of a Meetup can now return to its page on error
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Jean-Christophe Beaupré [Mon, 27 Oct 2014 16:17:49 +0000 (12:17 -0400)]
xml: Add an usage example.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Mon, 27 Oct 2014 15:45:06 +0000 (11:45 -0400)]
xml: Add some tests for SAXpohoNit.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Thu, 9 Oct 2014 14:53:46 +0000 (10:53 -0400)]
xml: Introduce SAXophoNit, a SAX processor in Nit.
For the moment, this implementation is mostly non-compliant, but it
works with most common XML documents.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Thu, 25 Sep 2014 19:25:03 +0000 (15:25 -0400)]
xml: Add classes to help testing a SAX parser.
Will be used to test SAXophoNit (A SAX parser in Nit).
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Fri, 19 Sep 2014 13:44:15 +0000 (09:44 -0400)]
xml: Port SAX 2.0.
This is a port of SAX 2.0.1 (http://www.saxproject.org) in Nit. The
following is **not** included in this port:
* Support for SAX1.
* Exceptions.
* Factories (requires run-time loading).
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Alexis Laferrière [Sat, 25 Oct 2014 13:07:52 +0000 (09:07 -0400)]
grammar: allow '`' inside foreign code blocks
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Lucas Bajolet [Mon, 27 Oct 2014 15:29:51 +0000 (11:29 -0400)]
opportunity: Changed layout from contrainer-fluid to container
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Mon, 27 Oct 2014 15:29:31 +0000 (11:29 -0400)]
opportunity: Corrected typo in welcome message
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Sat, 25 Oct 2014 01:59:36 +0000 (21:59 -0400)]
lib: add Text::justify
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 24 Oct 2014 23:58:38 +0000 (19:58 -0400)]
Merge: New constructors with the `new` keyword
`new` constructors where introduced with the FFI and generalized latter for intern methods.
This PR make them also legal with used-defined code in Nit.
~~~
abstract class Person
var age: Int
new(age: Int) do
if i < 18 then
return new Adult(age)
else
return new Child(age)
end
end
~~~
A `new` constructor is specified like a static method.
By default it returns the type of self, but this can be changed by the user.
This PR starts by generalizing the `new` constructors. Thus a lot of specific code in engine is removed.
Then additional rules are added to control the usage of user-defined `new` constructors.
The original code was great enough to accepts these new kind of method without heavy modification.
Pull-Request: #840
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Fri, 24 Oct 2014 23:58:35 +0000 (19:58 -0400)]
Merge: neo: Fix definition lists
Fix the code that load relationships between a property or a class and its definitions.
Pull-Request: #841
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 24 Oct 2014 23:58:26 +0000 (19:58 -0400)]
Merge: model: better implementation of the two `intro` methods
MClass and MProperty have a `intro` method to get the introducing
definition.
The initial implementation was to return the first known definition, that
make sense for a model constructed from a source-code where introductions
are read before refinements and redefinitions.
However, for a better robustness of the model that allows to load the
model form a serialized form or allows a model partially loaded, the
first-read definition is not necessary the intro.
This new implementation uses a different approach: the introduction is
the definition in the introducing compound (module for classes and
classdefs for properties). The introducing compound is known since the
construction, thus this new implementation is trivial and does not change
the API.
Rewrite-of: #841
Pull-Request: #843
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Thu, 23 Oct 2014 15:43:04 +0000 (11:43 -0400)]
tests: update some tests because buggy `new` are let untyped
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 23 Oct 2014 01:51:06 +0000 (21:51 -0400)]
tests: add base_new.nit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 23 Oct 2014 14:12:12 +0000 (10:12 -0400)]
typing: ANew accepts only `init` on concrete class
Signed-off-by: Jean Privat <jean@pryen.org>
Jean-Christophe Beaupré [Thu, 23 Oct 2014 19:33:17 +0000 (15:33 -0400)]
neo: Remove `is_intro`.
`is_intro` is computed by the model and is ignored anyway.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean Privat [Fri, 24 Oct 2014 00:37:53 +0000 (20:37 -0400)]
model: better implementation of the two `intro` methods
MClass and MProperty have a `intro` method the get the introducing
definition.
The initial implementation was to return the first known definition, that
make sense for a model constructed from a source-code where introductions
are read before refinements and redefinitions.
However, for a better robustness of the model that allows to load the
model form a serialized form or allows a model partially loaded, the
first-read definition is not necessary the intro.
This new implementation uses a different approach: the introduction is
the definition in the introducing compound (module for classes and
classdefs for properties). The introducing compound is known since the
construction, thus this new implementation is trivial and does not change
the API.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean-Christophe Beaupré [Thu, 23 Oct 2014 19:18:11 +0000 (15:18 -0400)]
neo: Fix linking between `MProperty` and `MPropDef`.
At loading, `neo.nit` linked each `MPropDef` two times to its
`MProperty`.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean Privat [Thu, 23 Oct 2014 01:48:05 +0000 (21:48 -0400)]
typing: `new`-fatories are like top-level methods
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 22 Oct 2014 19:03:46 +0000 (15:03 -0400)]
typing: allow `new` on interface and abstract classes that have a `new`-factory
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 22 Oct 2014 19:00:47 +0000 (15:00 -0400)]
typing: ANew distinguish the type of the class and the returned type
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 22 Oct 2014 18:56:15 +0000 (14:56 -0400)]
model: `new` factories have a return type.
The default is the definition class, so it remove a special case for
such methods.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 22 Oct 2014 18:52:16 +0000 (14:52 -0400)]
model: `new` factories are named "new", not init.
It means that in `new X`, first the method name `new` is searched,
then the method named `init` as a fallback.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 17 Oct 2014 09:57:22 +0000 (05:57 -0400)]
model-clients: use `is_root_init` instead of `.name == "init"`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 22 Oct 2014 22:45:27 +0000 (18:45 -0400)]
Merge: Some gammar improvements
A bunch of unrelated grammar work: bugfixes, a feature and stuff for future work.
The only implemented feature is the use of extended method identifiers in annotation (setters and operators)
~~~nit
class A
var foo: String is writable(real_foo=)
fun foo=(f: String) do
print "Hello!"
real_foo = f
end
end
~~~
Some additional syntax for future works are now accepted but are ignored (or will crash at compile-time).
* user defined factories in class (eg. define `new` in interface)
~~~
interface Buffer
new do return new FlatBuffer
end
var x = new Buffer
~~~
* code-block in attributes. when the default/lazy value is more complex than a single expression
~~~
class A
var foo: Int do
print "Hello!"
return 5
end
end
~~~
* generalized tuples. eg. for multiple returns, but more word is needed #839
~~~
fun foo(a,b: Int)
do
return (a/b, a%b)
end
~~~
In fact, generalized tuples accepts anything that annotations accepts... (eventually they will be rejected just after parsing)
~~~
var x = (1, Array[Int], for x in a do print x, toto=, -)
# in order: a literal expression, a type, a statement, a method identifier (setter),
# an other method identifier (the minus operator)
~~~
Pull-Request: #832
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Wed, 22 Oct 2014 14:24:46 +0000 (10:24 -0400)]
tests: update tests because the parser gets better to parse arbitrary things.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 21 Oct 2014 23:52:03 +0000 (19:52 -0400)]
parser: regenerate
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 21 Oct 2014 23:45:22 +0000 (19:45 -0400)]
grammar: allows blocks in attribute definitions
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 17 Oct 2014 09:55:28 +0000 (05:55 -0400)]
grammar: accepts new-factory with code
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 17 Oct 2014 02:44:18 +0000 (22:44 -0400)]
annotation: `as_id` works with operators and setters
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 17 Oct 2014 02:43:25 +0000 (22:43 -0400)]
parser: generalise Prod::collect_text
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 17 Oct 2014 02:33:37 +0000 (22:33 -0400)]
ast: accept methodid in at_args
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 17 Oct 2014 02:24:40 +0000 (22:24 -0400)]
grammar: add qmethid for qualified methid id
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 21 Oct 2014 23:42:20 +0000 (19:42 -0400)]
Merge: neo: Add `MAttributeDef.static_type` in the graph.
Pull-Request: #838
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean-Christophe Beaupré [Mon, 20 Oct 2014 17:40:59 +0000 (13:40 -0400)]
neo: Add `MAttributeDef.static_type` in the graph.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean Privat [Mon, 20 Oct 2014 13:48:17 +0000 (09:48 -0400)]
Merge: Fix the old bug where (-0.1).to_s == "0.-1"
Pull-Request: #820
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Mon, 20 Oct 2014 13:48:12 +0000 (09:48 -0400)]
Merge: neo: correct the documentation of neo.nit according to PR #781.
PR #781 changed the model, but not the documentation of neo.nit.
Pull-Request: #835
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Mon, 20 Oct 2014 13:47:55 +0000 (09:47 -0400)]
Merge: Small compiler things
Pull-Request: #834
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Mon, 20 Oct 2014 13:47:50 +0000 (09:47 -0400)]
Merge: file: Fix `join_path` to handle paths ending with a slash.
That way, we no longer need to manually remove the trailing slash before calling `join_path`.
Pull-Request: #833
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexis Laferrière [Fri, 17 Oct 2014 15:36:06 +0000 (11:36 -0400)]
tests: update savs for tests using the previously broken to_precision
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 12 Oct 2014 05:16:00 +0000 (01:16 -0400)]
lib/standard: fix `Float::to_precision`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean-Christophe Beaupré [Fri, 17 Oct 2014 14:41:12 +0000 (10:41 -0400)]
neo: correct the documentation of neo.nit according to PR #781.
PR #781 changed the model, but not the documentation of neo.nit.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean Privat [Fri, 17 Oct 2014 02:57:07 +0000 (22:57 -0400)]
abstract_compiler: prefers implementing expr than stmt in assignments
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 17 Oct 2014 02:56:17 +0000 (22:56 -0400)]
abstract_compiler: default stmt implmentation do not need to execute variables as statments
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 16 Oct 2014 04:18:04 +0000 (00:18 -0400)]
parser: add tuples
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 16 Oct 2014 01:18:46 +0000 (21:18 -0400)]
ast: remove classes AAtArg and make them simple AExpr
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 17 Oct 2014 00:21:34 +0000 (20:21 -0400)]
Merge: Robust debug
First pass on the debugger, simple cleanup/fixes that might be helpful for the end-user.
Addresses some of the issues mentioned in #742.
Pull-Request: #822
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 17 Oct 2014 00:21:14 +0000 (20:21 -0400)]
Merge: Brainfuck
As the name implies, this is a very simple Brainfuck interpreter written in Nit.
Yes, it is (mostly) useless, but it might serve as an example of a simple Nit program.
Pull-Request: #828
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Fri, 17 Oct 2014 00:21:10 +0000 (20:21 -0400)]
Merge: src: remove two TODO that are done/unneeded
Pull-Request: #830
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Fri, 17 Oct 2014 00:20:53 +0000 (20:20 -0400)]
Merge: Better varargs
since their introduction in Nit, varargs had a quick and dirty implementation.
They where implemented with a complex path in the low-level parts of engine instead being implemented at the AST level as it should be: varargs is more a syntactic sugar than something else.
Thus this PR changes the implementation of varargs in the engines.
This rationalize the `varargize` methods and simplify the code for low-level part (and also solve some bugs)
Additionally, the reverse-vararg, already accepted by the parser but unused until now, is implemented.
The principle it to pass an array where a vararg is expected.
Because of static ambiguities, the array passed as-is must be annotated with an ellipsis (`...`).
~~~nit
fun foo (xs: Object...) do print x.join("-")
foo(1,2,3) # prints "1-2-3"
var a = [1,2,3]
foo(a...) # prints "1-2-3"
foo(a) # pass `[a]`, a new array with a single element `a`, to foo, thus prints "123"
foo(1...) # Static Type Error: expected Array[Object], got Int.
~~~
Still, I think that error messages should be improved (cf. #98) but this seems to need some additional work in the error infrastructure.
A remaining question is what is the best acceptable type passed.
In the proposed implementation, the reverse-vararg must be a compatible Array (so a Sequence or a List are not accepted) and is given as is to the real method, that is allowed to modify it.
Should we change the type on a vararg to be a Sequence, a SequenceRead, of even a simple Collection ?
Pull-Request: #827
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Wed, 15 Oct 2014 18:53:16 +0000 (14:53 -0400)]
tests: add base_vararg3.nit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Oct 2014 14:46:39 +0000 (10:46 -0400)]
typing+engines: handle reverse-vararg: passing an array as-is.
Signed-off-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Sat, 11 Oct 2014 14:53:07 +0000 (10:53 -0400)]
lib/java: use Java's `toString` to implement Nit's `to_s`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 11 Oct 2014 14:52:26 +0000 (10:52 -0400)]
lib/java: intro `JavaObject::is_java_null`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean-Christophe Beaupré [Thu, 16 Oct 2014 18:16:52 +0000 (14:16 -0400)]
file: Fix `join_path` to handle paths ending with a slash.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Lucas Bajolet [Wed, 15 Oct 2014 18:15:59 +0000 (14:15 -0400)]
brainfuck: Added a simple Brainfuck interpreter
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Thu, 16 Oct 2014 00:29:19 +0000 (20:29 -0400)]
grammar: minus and once do not need nopar variants
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 16 Oct 2014 00:22:02 +0000 (20:22 -0400)]
src: remove two TODO that are done/unneeded
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Oct 2014 20:16:01 +0000 (16:16 -0400)]
Merge: Manpages
~~~sh
$ man nitg
~~~
A dream come true.
More seriously, toolcontext is extended to be able to generate manpages (in a similar way than completion).
Then a bunch of manpages is generated.
The content of the manpages should be improved but this is better than nothing.
Pull-Request: #825
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Wed, 15 Oct 2014 20:15:47 +0000 (16:15 -0400)]
Merge: transform loops
In order to activate more optimizations and simplify code generators and analysis, the `while` and `for` loops must be transformed into simpler forms (in fact in complex forms but with simpler elements)
However, to do such a transformation, the escaping mechanism (break/continue/goto) must be rewrote.
Previously, for each loop control structure (loop for, while), a single EscapeMark was generated and breaks and continues are associated to the same mark, even if they branch in distinct points (so each escapemark had 2 branching mechanisms)
Now, with the first commits, two escapemarks are generated for each loop control structure, and breaks and continues are associated to a different one. The advantage is that each mark only have a single branching mechanism and that once associated to their mark, there is no need to distinguish break and continue (both become simple gotos).
The transformations of loops can be then implemented.
The `while`
~~~
while cond do block
~~~
is transformed into
~~~
loop if cond then block else break
~~~
and `for`
~~~
for i in col do block
~~~
is transformed into
~~~
var it = col.iterator
loop
if it.is_ok then
var i = it.item
do block
# ^ `continue` in the block it attached to the `do`
# this is why the transformation of escape-marks where needed in fact.
# and break is associated to the main loop
it.next
else
break
end
end
it.finish
~~~
Note that these transformations are basically what is currently implemented in rta, niti and nitg. Except that, now with a single transformation point, those three workers does not need to do their own transformation and basically can just rely on the one done on the AST level.
Pull-Request: #818
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Wed, 15 Oct 2014 20:13:33 +0000 (16:13 -0400)]
Merge: console: use snake case.
Correct a little mistake.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Pull-Request: #826
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Wed, 15 Oct 2014 19:04:52 +0000 (15:04 -0400)]
share: generate stubs for manpages
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Oct 2014 01:59:06 +0000 (21:59 -0400)]
tests: update sav/test_toolcontext_args*.res
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 6 Oct 2014 12:48:32 +0000 (08:48 -0400)]
toolcontext: add --stub-man
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Oct 2014 15:15:28 +0000 (11:15 -0400)]
transform: move up shortcut-range from abstract_compiler to transform
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Oct 2014 15:11:48 +0000 (11:11 -0400)]
transform: shortcut range
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Oct 2014 04:28:37 +0000 (00:28 -0400)]
transform: transforms `while` and `for`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Oct 2014 04:27:47 +0000 (00:27 -0400)]
astbuilder: can make loops and breaks
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Oct 2014 02:33:38 +0000 (22:33 -0400)]
scope: create two escapemaks in loops
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Oct 2014 14:39:18 +0000 (10:39 -0400)]
global_compiler: remove useless methods since varargisation is done at the AST level
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Oct 2014 14:38:11 +0000 (10:38 -0400)]
compiler: do the varargization in the ANodes
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Oct 2014 14:30:34 +0000 (10:30 -0400)]
interpreter: remove useless methods `*call_without_varargs`
since varargs is now done at the AST level.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 15 Oct 2014 14:29:20 +0000 (10:29 -0400)]
interpreter: do the varargization in the ANodes
Signed-off-by: Jean Privat <jean@pryen.org>
Jean-Christophe Beaupré [Wed, 15 Oct 2014 14:18:40 +0000 (10:18 -0400)]
console: use snake case.
Correct a little mistake.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Lucas Bajolet [Tue, 14 Oct 2014 19:04:07 +0000 (15:04 -0400)]
debugger: Simplified names and integrate bad_command/help functions
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Conflicts:
src/interpreter/debugger.nit
Lucas Bajolet [Thu, 9 Oct 2014 18:59:37 +0000 (14:59 -0400)]
debugger: Added help/bad_command functions
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Thu, 9 Oct 2014 18:14:05 +0000 (14:14 -0400)]
debugger: Removed module Breakpoint, moved Breakpoint class to debugger module
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Alexis Laferrière [Sun, 12 Oct 2014 05:15:22 +0000 (01:15 -0400)]
lib/standard: improve documentation of `Float::to_s`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Mon, 13 Oct 2014 17:40:08 +0000 (13:40 -0400)]
Merge: src: remove some warnings and do some cleaning
Extracted from the first version of #817
Pull-Request: #819
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>