Commit Graph

791 Commits

Author SHA1 Message Date
Daniel Kolesa a6d0e787e4 eolian: no need to store 'parsed' table anymore either 2018-01-31 19:14:15 +01:00
Daniel Kolesa 8b1f2f34b4 eolian: simplify parsed checking 2018-01-31 19:06:37 +01:00
Daniel Kolesa f0877c9329 eolian: no need to track currently parsing file anymore 2018-01-31 18:13:29 +01:00
Daniel Kolesa b5794afa58 eolian: all dependency parsing is now deferred 2018-01-31 18:13:29 +01:00
Daniel Kolesa 5651b2e586 eolian: deferred parsing of inherits + better static checks
This change finally introduces deferred parsing of inherits to
Eolian, after a long time and many iterations. That means instead
of parsing inherits directly as part of the main file's parse pass,
they're pushed into a queue and parsed later. The validation engine
was modified to properly fill in the remaining info afterwards.

This may introduce breakages but I haven't noticed any. It also
properly unlocks cyclic dependency support in Eolian.

Additionally, this also introduces checks for duplicates in class
inherits (class Foo(Bar, Bar) is no longer possible) and it adds
stricter name checks, so you can no longer have a class Foo.Bar
and refer to it as Foo_Bar in implements. This was actually never
meant to be supported, but the check was previously broken.

@feature
2018-01-30 17:08:44 +01:00
Daniel Kolesa 7b643f6919 eolian: move impl/ctor fill to validation stage 2018-01-30 17:08:44 +01:00
Daniel Kolesa 1017f37de7 eolian: fix redefined function checks
For one, the hash has to be populated once per inheritance tree
and the skipping on already-validated funcs was interfering with
that as the function might have been validated in another
inheritance tree already.

Also, if a class appeared multiple times in an inheritance tree,
as is common with e.g. Efl.Object, it would get added into the
hash the first time and then checked against the second time,
which would result in a strange error message about the
function being redefined in its own class.

So now we prevent both cases from happening.
2018-01-18 12:49:05 +01:00
Vincent Torri f5b01ac5ce all: Simplify definition of EAPI
This will help in the transition from Autotools to Meson. This has been
tested on Windows for which EFL_XXX_BUILD were first introduced.
2018-01-18 18:04:03 +09:00
Daniel Kolesa d47610a732 eolian: do not require unit when stringifying types
As it is no longer necessary to pass unit when evaluating exprs,
it is not necessary to pass it here either. Convert all the APIs
to the new style and update all instances in our tree.
2018-01-16 16:39:05 +01:00
Daniel Kolesa dd2e579fec eolian: do not require unit for expr eval APIs
The necessary information is now stored directly in the expr
during database validation.

Also enable expr validation for params.
2018-01-16 16:37:52 +01:00
Daniel Kolesa b70604d018 eolian: cache enum expr in the database 2018-01-16 16:37:52 +01:00
Daniel Kolesa 29a9b9ad44 eolian: expose _eval_type to internals 2018-01-16 16:37:52 +01:00
Daniel Kolesa 54eac123c2 eolian: correctly validate function pointers 2018-01-12 19:14:13 +01:00
Daniel Kolesa c6436337a4 eolian: aliased_base_get funcs don't need unit 2018-01-12 18:05:13 +01:00
Daniel Kolesa 19c16b671e eolian: type_typedecl_get doesn't need a unit 2018-01-12 18:05:13 +01:00
Daniel Kolesa 707ed05d58 eolian: do not require unit for type_class_get 2018-01-12 18:05:13 +01:00
Daniel Kolesa db41734954 eolian: store typedecl/class in type 2018-01-12 18:05:13 +01:00
Daniel Kolesa efb419fd74 eolian: prevent unnecessary hash table allocs 2017-12-22 15:36:31 +01:00
Daniel Kolesa 65ea735fd7 eolian: remove the toplevel information 2017-12-22 15:36:31 +01:00
Daniel Kolesa 7da6675c34 eolian: perform partial class validation every time
This makes sure that duplicate method/part/etc checks are done on
every database update, removing the need for clunky toplevel
checks and improving reliability. It also sacrifices some
performance but it shouldn't be too bad (if a class is already
validated, some checks are avoided to speed things up).
2017-12-22 15:36:31 +01:00
Daniel Kolesa 30c5753172 eolian: deferred parsing of type deps 2017-12-22 15:36:31 +01:00
Daniel Kolesa e1bcd61bdf eolian: move inherit type checking to validation 2017-12-22 15:36:31 +01:00
Daniel Kolesa 03e77ea361 eolian: fix use-after-free in eo_parser
Thanks @netstar for finding this.

Fixes T6523.
2017-12-19 00:20:40 +01:00
Daniel Kolesa 373392d56e eolian: remove now unused database init/shutdown 2017-12-15 17:11:11 +01:00
Daniel Kolesa 18e18ca74c eolian: remove remaining global state (+ modify APIs accordingly) 2017-12-15 17:11:11 +01:00
Daniel Kolesa d624464ab4 eolian: filename retrieval APIs are read only 2017-12-15 17:11:11 +01:00
Daniel Kolesa c8aa30e698 eolian: make declaration APIs use units 2017-12-15 17:11:11 +01:00
Daniel Kolesa 9aaa5cf839 eolian: remove _cunit and prepare for returning actual units 2017-12-14 17:31:21 +01:00
Daniel Kolesa 2259b6f16f eolian: remove parent info from units (actually doesn't make sense) 2017-12-14 16:45:13 +01:00
Daniel Kolesa f9868b541e eolian: store unit inside lexer 2017-12-14 16:38:35 +01:00
Daniel Kolesa 535fa0e8f1 eolian: no need to init eina in db 2017-12-07 19:11:58 +01:00
Daniel Kolesa 3ebd1f1506 eolian: store units in state 2017-12-07 19:11:58 +01:00
Daniel Kolesa 8653d8cd73 eolian: properly free all hashes in state free 2017-12-07 19:11:58 +01:00
Daniel Kolesa e7bf69fc04 eolian: make deferred parsing map non-global 2017-12-07 19:11:58 +01:00
Daniel Kolesa 2343e6cc54 eolian: make parsing/parsed files mapping non-global 2017-12-07 19:11:58 +01:00
Daniel Kolesa 9a5c3cfbe2 eolian: remove internal state struct (rely on external Eolian state) 2017-12-06 15:07:31 +01:00
Daniel Kolesa a39d2e8fe5 eolian: move filenames hashes to state 2017-12-06 15:07:31 +01:00
Daniel Kolesa a25327c62e eolian: move constants to temporary state 2017-12-06 15:07:31 +01:00
Daniel Kolesa 21db23f702 eolian: move global vars to temporary state 2017-12-06 15:07:31 +01:00
Daniel Kolesa 7491f9353f eolian: move enums to temporary state 2017-12-06 15:07:31 +01:00
Daniel Kolesa 51ec796497 eolian: move structs to temporary state 2017-12-06 15:07:31 +01:00
Daniel Kolesa 8428eaa663 eolian: store aliases in temporary state 2017-12-06 15:07:31 +01:00
Daniel Kolesa 9fb3abc662 eolian: store classes in temporary state 2017-12-06 15:07:31 +01:00
Daniel Kolesa 14cd25a8d3 eolian: create an internal temporary state 2017-12-06 15:07:31 +01:00
Daniel Kolesa 8a1f93f698 eolian: pass state where necessary
This modifies the API so that global state removal is made
possible. It's still used internally for now but externally
the state is contained.
2017-12-05 16:41:42 +01:00
Daniel Kolesa 67e1c2ab88 eolian: add initial refcounting for database objects
This will be necessary once the unit system is in (it will be used
to keep track of multiple references to objects across units).
2017-12-05 16:41:42 +01:00
Daniel Kolesa 2a0f873c84 eolian: pass unit within validation engine 2017-12-05 16:41:42 +01:00
Daniel Kolesa e83e089765 eolian: contain master state in a larger structure 2017-12-05 16:41:42 +01:00
Daniel Kolesa 53aa99550d eolian: add API for master unit creation 2017-12-05 16:41:42 +01:00
Daniel Kolesa 6abb24b717 eolian: create an actual unit structure for files
Units now form an actual tree stored in their own hash. This will
later replace all global state of Eolian, by introducing a master
unit that you will pass around.
2017-12-05 16:41:42 +01:00