Daniel Kolesa
f5c85daca7
eolian: add API that will allow for additional static analysis
...
Currently this API does nothing.
2018-05-03 17:14:39 +02:00
Cedric BAIL
042de32421
eolian: remove old support for Efl_Future.
2018-05-01 10:39:01 -07:00
Daniel Kolesa
bef66f507d
eolian: check event vs function/part conflicts as well
...
Still behind the env var, because there would be a lot of failures
otherwise.
2018-04-26 16:41:32 +02:00
Daniel Kolesa
d810c1e71d
eolian: use pointer hashes in validation for performance
...
We can use pointer hashes because the keys will have the same
addresses during validation. This should be faster, so do that.
2018-04-26 16:23:13 +02:00
Daniel Kolesa
a0e7564836
eolian: stricter function/part redef checks
...
Now we also check part redefinitions and function redefinitions
are checked against parts as well.
2018-04-26 16:15:04 +02:00
Daniel Kolesa
f796a21d72
eolian: add event redefinition checks
...
As EFL fails build with this enabled, hide these behind the
EOLIAN_EVENT_REDEF_WARN environment variable for the time being.
2018-04-26 16:15:04 +02:00
Daniel Kolesa
6f69a8c56d
eolian: clear chash on each iteration during validation
...
This is necessary because inheritance trees need to be validated
individually for proper name conflict checks. It also prevents
eina_hash_add related errors.
2018-04-26 16:15:04 +02:00
Daniel Kolesa
dd90488b69
eolian: add capturing of variables/typedecls in expr eval
...
This will be used from validation to properly count actual
dependencies of a unit.
2018-04-20 16:10:55 +02:00
Daniel Kolesa
591567a6ac
eolian: add 'parse' directive
...
This is much like 'import' but doesn't add the imported file into
the dependency list for the current file. This is to enable doc
reference validation to remain functional without needlessly
introducing file dependencies just to satisfy it.
2018-04-20 16:10:55 +02:00
Daniel Kolesa
a2ccdb7b21
eolian: re-enable non-dependencied parsing
...
The issue was that standalone-parsed files (outside of dependencies
of some other unit) were not being included in that dependency tree
(obviously) which resulted in their own dependency tree being
excluded from merging, causing the database hashes to lack the
necessary elements.
To fix this, I trigger merging of the "standalone" dependency trees
separately, by calling _merge_units from defer parsing cb.
2018-04-19 13:44:14 +02:00
Daniel Kolesa
974fa323a1
eolian: disable non-dependencied parsing for the time being
...
As 543902f2ba
breaks build,
disable parsing with state as a parent for now, until the issue
is figured out.
2018-04-18 21:17:31 +02:00
Daniel Kolesa
543902f2ba
eolian: make doc ref resolution global
...
Doc refs no longer introduce new dependencies into files. Instead,
they're parsed globally, and any doc ref lookup is also made
globally. This allows unit based dependencies to correspond more
to what files actually really need at compile time/runtime, with
docs being irrelevant to that; it also simplifies the API.
The doc resolution API now takes Eolian_State instead of
Eolian_Unit, too.
2018-04-18 16:38:14 +02:00
Daniel Kolesa
d13cfe1b83
eolian: doc ref validation cleanup
2018-04-18 16:38:14 +02:00
Daniel Kolesa
28b1dd25c7
eolian: add internal api for dep deferring + parsing without dep
...
This is cleaner than adding into a hash manually. Additionally, it
is now possible to request that the file be parsed not as a dep,
but rather standalone, which will be useful later.
2018-04-18 16:38:14 +02:00
Daniel Kolesa
311fada0d2
eolian: simpler and more efficient defer parsing
2018-04-18 16:38:14 +02:00
Daniel Kolesa
2defb32214
eolian: correct line/column number during doc reference validation
...
Eolian doc objects now bundle debug information necessary to
provide correct line/column numbers. It is not possible to get
this information cirectly from the text, as it's reformatted and
contains no extra whitespace or newlines beyond paragraph
separators.
Fixes T6701.
2018-04-12 15:24:15 +02:00
Daniel Kolesa
e9811c6596
eolian: simplify class validation logic
2018-04-11 14:58:41 +02:00
Daniel Kolesa
710748c551
eolian: better/more robust class inheritance list replacement
2018-04-11 14:31:03 +02:00
Daniel Kolesa
284e352811
eolian: _ is allowed in doc references
2018-04-05 13:54:20 +02:00
Daniel Kolesa
474a2a319b
eolian: completely scoped validation
...
This is much stricter than the previous behavior,
as it allows no leakage of information from the
outside to the inside.
2018-03-27 13:48:58 +02:00
Daniel Kolesa
e4fd05469d
eolian: validate each class with its own unit's in mind only
...
This is stricter (doesn't allow outer symbols to leak in).
Also needed fixing some eo files.
2018-03-27 13:27:46 +02:00
Daniel Kolesa
2c76889347
eolian: fix segfault on error when input file fails to open
2018-03-26 11:57:53 +02:00
Daniel Kolesa
d98dd33648
eolian: fill missing fields in doc objects
2018-03-26 11:56:26 +02:00
Daniel Kolesa
3bddb2b6c4
eolian: commit all changes into staging area first
2018-03-22 18:01:31 +01:00
Daniel Kolesa
806c30ec34
eolian: complete staging area merge logic
2018-03-22 17:56:52 +01:00
Daniel Kolesa
db04d3f670
eolian: introduce main and staging areas properly
...
The state is now correctly divided. No merging is performed yet,
which is to be done next.
2018-03-22 17:56:52 +01:00
Daniel Kolesa
3ae67b24b3
eolian: validate staging unit when parsing all
2018-03-22 16:27:35 +01:00
Daniel Kolesa
93a64c5eab
eolian: clean rollback support
...
Previously, when an error happened in Eolian, the state was left
in a presumably unusable and inconsistent condition. This work
aims to change that, as all changes are committed into a staging
area before being validated and merged back into main state.
This is not yet complete, as units and by-file lookups are not
currently involved in the rollback. This will change in the
subsequent commits.
@feature
2018-03-22 15:37:25 +01:00
Daniel Kolesa
d9a8fe0fca
eolian: add state staging area
...
This will be used for clean rollbacks on errors.
2018-03-22 15:37:25 +01:00
Daniel Kolesa
bc182e69d7
eolian: flush defer table before parsing
2018-03-22 15:37:25 +01:00
Daniel Kolesa
2db8e8e914
eolian: make use of panics for certain alloc errors
2018-03-20 17:34:51 +01:00
Daniel Kolesa
7c6d8010a8
eolian: no need for printf-style for internal log funcs
2018-03-20 17:34:51 +01:00
Daniel Kolesa
a1ae5cd918
eolian: use new error logging for all recoverable errors
2018-03-20 17:34:51 +01:00
Daniel Kolesa
9610459502
eolian: add APIs to get unit from object and state from unit
2018-03-16 16:16:16 +01:00
Daniel Kolesa
60c733670d
eolian: intial API for a new error mechanism
...
Unlike panic, this will be used to handle regular errors
such as parse errors. There will be no jumps and you
will be able to pass in a pointer to get the error
data into some local memory. That way you will be
able to override printing error messages.
2018-03-16 16:07:12 +01:00
Daniel Kolesa
927bcfd60a
eolian: initial API for a new panic mechanism
...
This will be used to handle unrecoverable errors.
For robustness, you will be able to set a custom
panic callback, jump and try to recover manually.
2018-03-16 15:41:57 +01:00
Daniel Kolesa
a848278782
eolian: simplify lexer init
2018-03-16 14:49:35 +01:00
Daniel Kolesa
bf1e3a702f
eolian: event/function_get_by_name -> by_name_get
2018-03-16 14:26:15 +01:00
Daniel Kolesa
6c0180d7f8
eolian: more stringent and fine-grained validation
2018-03-16 00:14:13 +01:00
Daniel Kolesa
fed326a3ef
eolian: fix unit child management
...
Also pass correct unit to validation for performance.
2018-03-16 00:10:13 +01:00
Daniel Kolesa
2760f047d3
eolian: merge objects in units
2018-03-15 23:32:20 +01:00
Daniel Kolesa
978ba5052d
eolian: reduce the number of database traversals during validation
...
This significantly improves performance by not iterating certain
paths multiple times.
2018-03-15 23:25:35 +01:00
Daniel Kolesa
2c59abc878
eolian: fix minor memory leaks
2018-03-15 16:45:23 +01:00
Daniel Kolesa
edc73c4c4c
eolian: make sure dtors are always run correctly
2018-03-15 16:34:39 +01:00
Daniel Kolesa
df83efcef9
eolian: remove the temps system
2018-03-15 16:34:39 +01:00
Daniel Kolesa
5178b15ac5
eolian: manage exprs through node system
2018-03-15 16:34:39 +01:00
Daniel Kolesa
da47159dbd
eolian: manage typedecls through node system
2018-03-15 16:34:39 +01:00
Daniel Kolesa
80445f5160
eolian: manage class/vars through new node system
2018-03-15 16:34:39 +01:00
Daniel Kolesa
aa313ccfb6
eolian: store types in node hash
2018-03-15 16:34:39 +01:00
Daniel Kolesa
cd49130df7
eolian: generic dtor management for lexer
2018-03-15 16:34:39 +01:00
Daniel Kolesa
916c8cb046
eolian: unified node allocation api
2018-03-15 16:34:39 +01:00
Daniel Kolesa
938acf22c0
eolian: in-lexer-state current class storage
2018-03-15 16:34:39 +01:00
Daniel Kolesa
ab43e61ef6
eolian: turn some state APIs into inlines over unit APIs
2018-03-14 17:20:49 +01:00
Daniel Kolesa
2d0a25c995
eolian: refactor doc ref resolution API
2018-03-14 16:51:11 +01:00
Daniel Kolesa
1f4d919cf9
eolian: update type/var name APIs
2018-03-12 16:28:28 +01:00
Daniel Kolesa
35d9ef2dd2
eolian: make more name APIs into inline helpers
2018-03-12 16:16:43 +01:00
Daniel Kolesa
edcd81ee49
eolian: update class name APIs
2018-03-12 16:03:37 +01:00
Daniel Kolesa
0f0009cb4f
eolian: expose short_name/namespaces via object
2018-03-12 13:55:21 +01:00
Daniel Kolesa
94e1487ed8
eolian: use short name for function pointer name
2018-03-12 12:26:17 +01:00
Daniel Kolesa
5cc3abb425
eolian: only merge units on success when parsing all files
2018-03-12 11:37:02 +01:00
Daniel Kolesa
665fc62916
eolian: simplify namespace handling
...
This is mostly a preparation for rework of name(space) APIs.
2018-03-11 17:35:13 +01:00
Daniel Kolesa
342974977f
eolian: resolve to Eolian_Objects instead of voids
2018-03-09 15:25:36 +01:00
Daniel Kolesa
c7fd43ad4e
eolian: return Eolian_Object_Type from ref resolver
...
This needs only one enum and allows for better interop.
2018-03-09 15:25:36 +01:00
Daniel Kolesa
7a4669b1b7
eolian: remove old declaration APIs
2018-03-08 23:59:40 +01:00
Daniel Kolesa
1e8de641d8
eolian: tests for new object apis
2018-03-08 23:16:40 +01:00
Daniel Kolesa
c6e0b7f44e
eolian: remove obsolete file_get APIs
2018-03-08 22:54:12 +01:00
Daniel Kolesa
2248131295
eolian: give objects names, and reduce duplication
2018-03-08 19:47:28 +01:00
Daniel Kolesa
917a5216f8
eolian: add APIs to retrieve declarations as objects
...
This will replace the old declarations API.
2018-03-08 19:00:32 +01:00
Daniel Kolesa
9594f09156
eolian: add API to query information about Objects
...
As nearly every Eolian handle is backed by an Eolian_Object,
this information is now publicly exposed and has an API. This
opens up an array of new possibilities for tooling, as you
can now externally query file names, line numbers etc.,
as well as cast arbitrary handles to Eolian_Object pointers
and back.
This will be expanded later and it will replace the Declaration
system, as it's cleaner, better integrated and more versatile.
@feature
2018-03-08 17:32:38 +01:00
Daniel Kolesa
482c5d1ba2
eolian: get rid of old APIs for typedecl retrieval
2018-03-07 13:53:08 +01:00
Daniel Kolesa
f596a97da6
eolian: remove old variable retrieval APIs
2018-03-07 13:25:28 +01:00
Daniel Kolesa
434b0a399d
eolian: remove old class retrieval APIs
2018-03-07 13:08:49 +01:00
Daniel Kolesa
b799fb1959
eolian: remove old APIs for path retrieval
2018-03-02 13:53:34 +01:00
Daniel Kolesa
b45dc505cd
eolian: remove old directory_scan/file_parse APIs
2018-03-02 13:46:57 +01:00
Daniel Kolesa
f8505eddbd
eolian: new APIs for typedecl lookups
2018-03-01 12:42:40 +01:00
Daniel Kolesa
e28e481cca
eolian: new variable lookup APIs
2018-03-01 12:16:28 +01:00
Daniel Kolesa
d6382f3f2b
eolian: new APIs for class retrieval
2018-03-01 12:16:28 +01:00
Daniel Kolesa
7a68ea5edb
eolian: rename path/filename retrieval APIs
2018-02-27 16:12:35 +01:00
Daniel Kolesa
b3596252eb
eolian: rename all_files_parse functions
2018-02-27 16:12:35 +01:00
Daniel Kolesa
9f79d4ff22
eolian: eolian_file_parse -> eolian_state_file_parse
2018-02-27 16:12:35 +01:00
Daniel Kolesa
436f2d3363
eolian: add API to get file name of a unit
2018-02-27 16:12:35 +01:00
Daniel Kolesa
7d001fd93f
eolian: add API to get children of a unit
2018-02-27 16:12:35 +01:00
Daniel Kolesa
e91ae3984a
eolian: add APIs to retrieve units from a state
2018-02-27 16:12:35 +01:00
Daniel Kolesa
f5e3734cdd
eolian: new APIs for directory scanning
2018-02-27 16:12:35 +01:00
Daniel Kolesa
6a284e48c9
eolian: eolian_* -> eolian_state_*, Eolian -> Eolian_State
2018-02-27 16:12:35 +01:00
Daniel Kolesa
a11e70ab3c
eolian: perform correct unit lookups in public API
...
This finally enables looking up things from the current unit
rather than from a backing storage in the Eolian state. This
also means that the benefits of having a unit system will
finally be visible.
2018-02-23 15:34:52 +01:00
Daniel Kolesa
39820fb5f5
eolian: simplify adding/refcounting objects
2018-02-23 15:25:55 +01:00
Daniel Kolesa
1a7dabeb74
eolian: proper in-unit storage for all declarations
...
This makes sure variables are stored as well as types within their
respective units. Also, declarations are now refcounted just like
any other Eolian object.
2018-02-23 15:25:55 +01:00
Daniel Kolesa
26f0c56faf
eolian: fix eina hash usage so it doesn't consume all your memory
...
This makes sure items are checked before being added, so that eina
hash doesn't get confused, add each item thousands of times and
run out of memory.
2018-02-22 11:19:23 +01:00
Daniel Kolesa
665b88204c
eolian: store types/typedecls in units
2018-02-22 11:19:22 +01:00
Daniel Kolesa
7b5a73b967
eolian: add eolian_object_add wrapper
2018-02-22 11:19:22 +01:00
Daniel Kolesa
76b9f4c224
eolian: prepare for proper unit API by merging unit hashes
...
Eolian now properly merges all unit hashes (e.g. unit A has
children B and C, hashes of B and C are merged into A's hashes
in order to be able to look up B and C's contents via A) and
maintains a (potentially cyclic) children graph.
Not everything is yet added into all hashes, but at least the
building blocks are there.
2018-02-21 17:09:08 +01:00
Mike Blumenkrantz
1f32a4fcd2
eolian: always print error and fail when name conflicts are detected
2018-02-15 13:50:56 -05:00
Daniel Kolesa
0745ec922b
eolian: properly initialize warned (to avoid random parse failures)
2018-02-13 21:48:46 +01:00
Daniel Kolesa
c82b30cc3c
eolian: print all duplicate warnings before aborting build
...
Instead of aborting at the first warning, accumulate the warnings
and stop at the end of validation.
2018-02-13 10:17:41 +01:00
Daniel Kolesa
09bcf9e5fd
eolian: stop build with EOLIAN_WARN_FUNC_DUPLICATES > 1
2018-02-12 18:56:38 +01:00
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