Commit Graph

373 Commits

Author SHA1 Message Date
Lauro Moura 86191b02c7 eolian: Leave default text for libeolian users
Summary:
Instead of setting the default text at the library level, keep the
summary empty if nothing is provided.

The libeolian users them are free to check if the summary was actually
empty or a placeholder text was added.

ref T8309

Test Plan: Run attached tests

Reviewers: q66, segfaultxavi

Subscribers: cedric, brunobelo, #reviewers, felipealmeida, #committers

Tags: #efl

Maniphest Tasks: T8309

Differential Revision: https://phab.enlightenment.org/D10285
2019-10-09 16:18:30 +02:00
Xavi Artigas 835e230f2f Revert "eolian: disallow missing docs for stable API where necessary"
I'm afraid but this breaks the mono bindings too close to a release.
This also fixes the missing docs errors by adding a lot of inconsistent
placeholder text ("No description supplied.", "TBD") which will make
finding them later on more complicated.

I was the one that asked for this feature but it is not critical at this
point, so I suggest we explore some refinements (like T8291) before landing
this patch in its current state.

This reverts commit 2946cb3c32.
2019-09-30 19:48:19 +02:00
Daniel Kolesa 2946cb3c32 eolian: disallow missing docs for stable API where necessary
The things that require docs include classes, variables, typedecls,
events and methods/properties. Implements, params, returns, parts
and struct/enum fields don't require them.

Empty/whitespace only string does not count as documentation.
2019-09-30 18:21:17 +02:00
Daniel Kolesa b0ee540ec9 eolian: rename param direction enum and fields for consistency 2019-09-26 16:56:13 +02:00
Daniel Kolesa 6d93dc4cbf eolian: rename event_prefix to event_c_prefix for consistency 2019-09-26 16:47:22 +02:00
Daniel Kolesa 71cd89c580 eolian: expose most API as stable
There is still some TODO with builtin types, parameter
directions and prefixes, which will be resolved in the
next commits.
2019-09-25 18:26:07 +02:00
Daniel Kolesa 92da64a532 eolian: remove support for globals
This was meant to happen but did not previously happen. It is not
ideal to do it now but better do it while we still can.

In short, this removes one half of the variables API (keeps
constants as they are) and repurposes the API to be only for
constants. This is also better for consistency to match errors.
2019-09-24 18:27:37 +02:00
Daniel Kolesa 251d8fc6bd eolian: remove global vars from tests 2019-09-24 16:29:55 +02:00
Daniel Kolesa 718f3cd495 eolian: make hashes beta-only for now
They're not completely settled on and we don't even know if we want
them at all. So let's make them beta only for now.

Ref T8050.
2019-09-20 17:04:48 +02:00
Daniel Kolesa b74f98e8b7 efl: replace composite with composites and dedup implements
Since using 'composites' now automatically implements what has not
been implemented yet, remove the unnecessary duplicates.
2019-09-19 18:20:56 +02:00
Daniel Kolesa 81441638db eolian: enable unimplemented function errors for stable API 2019-09-17 12:36:50 +02:00
Daniel Kolesa d9594dbc9d eolian: drop @ctor_param and the associated APIs
This has been unused for a while, and has been just lingering
around the code, so drop it so it doesn't make it into a release.
2019-09-16 15:37:04 +02:00
Daniel Kolesa 267c57d0f1 eolian: remove second parameter for eolian_type_c_type_get
This has been replaced by newer APIs.
2019-09-09 18:26:49 +02:00
Daniel Kolesa eb25e92770 eolian: change composite syntax from block to inheritance section
This makes more sense as these are related to inheritance tree.
Therefore, change while we still can.

Fixes T8183
2019-09-06 15:14:20 +02:00
Daniel Kolesa 04b0321bea eolian: update C generator to respect by_ref as well as tests 2019-09-05 15:19:28 +02:00
Daniel Kolesa 6751f011c1 eolian: remove the expression eval_type API
This is unnecessary because for all contexts where type is
relevant the validator already makes sure the type and expression
match correctly, so you don't ever need to re-validate it. If you
are doing a generic case and are not sure, just use MASK_ALL.
2019-09-04 18:02:47 +02:00
Daniel Kolesa 8b49bdb830 eolian tests: use new c_type APIs 2019-09-04 16:27:54 +02:00
Daniel Kolesa 0b6e8f71f1 eolian: move all tests to use the new @move syntax and API 2019-09-02 15:24:14 +02:00
Daniel Kolesa 66b0555f59 eolian: disallow legacy keyword in enums in stable api
This also marks a bunch of users of that as beta, as they were
effectively beta.
2019-08-29 15:06:08 +02:00
Daniel Kolesa 2f147f2725 eolian: rename is_class api for functions to is_static
Still needs restriction to classes only etc to be done later.

Ref https://phab.enlightenment.org/T8118
Ref https://phab.enlightenment.org/T7675
2019-08-16 16:33:37 +02:00
Daniel Kolesa 8a8a833837 eolian: rename @class on methods to @static
Ref https://phab.enlightenment.org/T8118
Ref https://phab.enlightenment.org/T7675
2019-08-16 16:27:00 +02:00
Daniel Kolesa 1c5fa59ee8 eolian: remove __builtin_free_cb
This has long been unused. If we need to replace this eventually,
it should be done correctly.
2019-08-01 16:55:31 +02:00
Daniel Kolesa 1bcca58d82 eolian: disallow ptr() in containers in stable API 2019-08-01 16:55:31 +02:00
Daniel Kolesa 1a95e87f58 eolian: fix tests after latest restrictions 2019-07-26 14:39:38 +02:00
Marcel Hollerbach 3eb7b3793b eolian: start to express ownership transfere
before @owned was not even expressed in the api definitions of the
generated APIs, this adds support for it.

@owned is now expressed with EFL_TRANSFER_OWNERSHIP in a arguments. And
that preprocessor directive is documented.

Reviewed-by: Daniel Kolesa <daniel@octaforge.org>
Differential Revision: https://phab.enlightenment.org/D9369
2019-07-23 18:09:36 +02:00
Daniel Kolesa 5b00dc344f eolian: allow value types in view containers (iterators etc.)
This restricts disallowing value types to containers that can own
them.

It also disallows usage of @owned on those view-only containers,
as that makes no sense.
2019-06-26 14:05:46 +02:00
Daniel Kolesa 1bbf4380ab eolian: add library support for declaring and using errors
You can now declare errors like this:

error Foo = "message"; [[documentation]]

Then you can use them as types like this:

foo {
    return: error(Error1, Error2, ...);
}

They have a separate type category and storage. They are checked
for redefinitions the same as anything else though. This does
not add any generator support nor it adds any advanced checking.

Ref T6890
2019-06-24 15:15:30 +02:00
Vincent Torri 3ddbda1266 remove last bits of Evil.h in tests and use evil_private.h instead
Test Plan: compilation

Reviewers: zmike, raster, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9154
2019-06-24 09:01:25 -04:00
Vincent Torri ba22016c4c tests: fix warnings and undef ref on Windows (using meson :-) )
Summary: we need to include evil_private.h so that some symbols are declared

Test Plan: compilation

Reviewers: raster, zmike, cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9129
2019-06-20 12:50:35 +01:00
Daniel Kolesa b4dd54617f eolian: add test for file versioning 2019-05-26 18:26:49 +02:00
Daniel Kolesa d0fed247bb eolian: remove param @nonull
This has been deprecated for a while and is not strictly necessary
- as a part of an effort to stabilize Eolian, remove this. Eolian
will eventually gain support for versioning and use a reversed
behavior (i.e. no NULL by default), but the API it wlll use for
that will be very different. Features can always be added, it's
much harder to drop them.

@feature
2019-05-26 17:25:15 +02:00
Daniel Kolesa 5ea0195661 eolian: remove @nullable keyword
This was an experiment that never properly took off and was never
used by any generator. Its use was highly variable, so it could
not be relied upon. We will still want to reverse the current
behavior eventually (no null by default), but that will be
done with eo file versioning in the future.

@feature
2019-05-21 16:04:35 +02:00
Daniel Kolesa 5922bb268f eolian tests: rename owning.eo.c to clear confusion 2019-05-17 16:08:23 +02:00
Daniel Kolesa b3a870c7bb eolian: rename eolian_typedecl_enum_field_c_name_get
This is to allow for better object oriented APIs, as the `c_name`
field would be inherited from Object. This also makes it more
clear in C.
2019-05-16 15:52:46 +02:00
Daniel Kolesa 4ab1f2388e eolian: add API to retrieve the C name of an object
This is to prepare for type/class renaming support. This adds
the necessary API to retrieve C-specific names. Other refactoring
is necessary elsewhere for now.

This also renames the old API eolian_class_c_name_get to
eolian_class_c_macro_get to avoid conflict as well as clarify
the intention.
2019-05-16 15:43:52 +02:00
Mike Blumenkrantz 7c7998b3dc meson: enforce 61s timeout for tests, remove explicit timeouts from build files
unit tests automatically abort with info after 60s, and tests should be run with
an appropriate timeout to avoid conflict with the test runner's default 30s timeout

set explicit timeout in eio test for now because there's still frequent bugs here

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8894
2019-05-15 18:49:51 +02:00
Daniel Kolesa 6312cafe20 eolian: move from eo_prefix to c_prefix 2019-05-09 16:17:44 +02:00
Daniel Kolesa 159e955168 eolian: fix conflicts between eo file names in tests
Fixes T7911.
2019-05-06 17:05:22 +02:00
Daniel Kolesa 653fddfc1e eolian: add support for marking and checking parts as beta
Fixes T7837.
2019-05-05 17:07:26 +02:00
Daniel Kolesa abedd9cc09 eolian tests: use parse instead of path_parse 2019-05-03 17:08:34 +02:00
Daniel Kolesa db57523e78 eolian: refactor parsing API and path handling
This splits the eolian_file_parse API into two, one for parsing
files already present in the database (always by filename) and
one for parsing paths.

It fixes several bugs/leaks on the way (incorrect use of
stringshare etc.) as well as adds checking for whether there
are no conflicting filenames at scan time, for free. That means
it is now no longer possible to scan two paths which have an eo
or eot file of the same name in them.

It should also be faster now.

It also fixes T7820.

@fix
2019-05-03 17:06:49 +02:00
Daniel Kolesa 6ee2df55aa eolian: remove legacy generation from tests 2019-04-18 19:35:53 +02:00
Cedric BAIL bc12d9feb5 eo: make reflection getter const function.
Getter are usually not modifying there object. This is going to put a strong
limit on what a getter property for MVVM is, as it will prevent any side
effect on getting a property from a View.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7969
2019-03-08 14:31:08 -08:00
Daniel Kolesa cf200a7d28 eolian: remove legacy handling API and most of generation
Summary:
This removes all Eolian API that deals with handling of legacy
code. It also removes the code using it in the generator as well
as bindings, but for now keeps generation of .eo.legacy.h types,
as there are still instances in our codebase where things are
otherwise broken. We can remove the rest once that is resolved.

Reviewers: zmike, cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8255
2019-03-08 10:12:09 -05:00
Lauro Moura 73cbc48669 eolian: Fix struct database registration.
Summary:
It was mistankely swapping regular and inlist structs when registering
after parsing, causing functions like eolian_state_structs_by_file_get
to return wrong data, breaking C# bindings.

Also added a simple test.

Reviewers: q66, bu5hm4n, zmike, cedric, felipealmeida, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8047
2019-02-28 12:01:31 +01:00
Daniel Kolesa dc492b1586 eolian: introduce typed slice types
Summary:
This adds two new complex types, slice<T> and rw_slice<T>. This
is necessary to make the type useful to bindings, as Eina_Slice
on its own says nothing about what it's carrying and that prevents
useful code from being generated outside of C.

@feature

Reviewers: bu5hm4n, segfaultxavi, lauromoura, cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7980
2019-02-22 16:18:49 +01:00
Cedric BAIL b23f65291f eo: make reflection setter able to return an error code in case of failure.
Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Differential Revision: https://phab.enlightenment.org/D7935
2019-02-21 11:54:09 -08:00
Daniel Kolesa b6b7317f4e eolian gen: generate a separate file with legacy implementations
If legacy implementations are generated, eolian_gen now creates
a separate file for them and includes it. The file name convention
for that is <.c file name without ext>.legacy.<.c file name ext>
or <.c file name>.legacy.c if it has no ext, so for example
foo.eo.c becomes foo.eo.legacy.c and foo becomes foo.legacy.c.

The file is generated assuming there are any legacy APIs contained
inside the .eo file.
2019-02-21 16:52:40 +01:00
Daniel Kolesa 9674dadbda eolian: restrict usage of ptr() to directly used types
That means, it can only now be used on parameters and struct
fields, never aliased within typedefs. This simplifies the
logic so that we don't have ptr metadata buried several layers
deep.
2019-02-17 02:26:22 +01:00
Daniel Kolesa 8952c05ddd eolian gen: initial support for reflection api
This adds support for generating reflection functions for
properties. This support is basic for now, supporting only
primitive types and string(shares), it will be expanded later
as required.

@feature
2019-02-15 17:17:15 +01:00