grammar: remove no before comma in idlist

Signed-off-by: Jean Privat <jean@pryen.org>
grammar: remove useless production expr_final

Signed-off-by: Jean Privat <jean@pryen.org>
ast: kill AProxyExpr

Signed-off-by: Jean Privat <jean@pryen.org>
grammar: minus and once do not need nopar variants

Signed-off-by: Jean Privat <jean@pryen.org>
ast: remove classes AAtArg and make them simple AExpr

Signed-off-by: Jean Privat <jean@pryen.org>
parser: add tuples

Signed-off-by: Jean Privat <jean@pryen.org>
grammar: add qmethid for qualified methid id

Signed-off-by: Jean Privat <jean@pryen.org>
ast: accept methodid in at_args

Signed-off-by: Jean Privat <jean@pryen.org>
parser: generalise Prod::collect_text

Signed-off-by: Jean Privat <jean@pryen.org>
annotation: `as_id` works with operators and setters

Signed-off-by: Jean Privat <jean@pryen.org>
grammar: accepts new-factory with code

Signed-off-by: Jean Privat <jean@pryen.org>
grammar: allows blocks in attribute definitions

Signed-off-by: Jean Privat <jean@pryen.org>
parser: regenerate

Signed-off-by: Jean Privat <jean@pryen.org>
tests: update tests because the parser gets better to parse arbitrary things.

Signed-off-by: Jean Privat <jean@pryen.org>
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>
model-clients: use `is_root_init` instead of `.name == "init"`

Signed-off-by: Jean Privat <jean@pryen.org>
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>
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>
typing: ANew distinguish the type of the class and the returned type

Signed-off-by: Jean Privat <jean@pryen.org>
typing: allow `new` on interface and abstract classes that have a `new`-factory

Signed-off-by: Jean Privat <jean@pryen.org>