Merge: frontend: introduce `parse_annotations` phase
authorJean Privat <jean@pryen.org>
Mon, 19 Jun 2017 20:23:39 +0000 (16:23 -0400)
committerJean Privat <jean@pryen.org>
Mon, 19 Jun 2017 20:23:39 +0000 (16:23 -0400)
A simple annotations access framework.

Useful when you only need to know if a module, class or property definition contains an annotation in its source code and you don't have a modelbuilder.

One the phase is applied one can access the annotations through the related MEntity:
~~~nit
fun is_annotated_with_foo(mentity: AnnotatedMEntity): Bool do
    return mentity.has_annotation("foo")
end
~~~

I introduced a specific super class to avoid the introduction of `annotations` directly into the MEntity since the concept of annnotations is weird when talking about a MClass or a MType.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #2504


Trivial merge