Commit Graph

900 Commits

Author SHA1 Message Date
Daniel Kolesa 175b25ab2e eolian: integrate event type requirement into eo file grammar 2018-05-19 01:49:06 +02:00
Daniel Kolesa f747df69f9 eolian: force-enable event type checks
Now that event types have all been fixed, force-enable the
validation check.
2018-05-19 01:45:38 +02:00
Daniel Kolesa ba31824a86 eolian: more useful namespace checks with no false negatives 2018-05-15 16:42:01 +02:00
Daniel Kolesa d26b6d0f22 eolian: initial simple namespace conflict check 2018-05-15 16:25:23 +02:00
Daniel Kolesa 6bcd70f01d eolian: fix false negatives in unused dependency static checker
It is not necessary to check entire classes/typedecls/variables
when referenced, as that also checks their contents and adds
false negatives. It is enough to simply add their own unit
as a 'used' dependency and let the system do the work, besides
for actual declarations in the checked file.
2018-05-13 18:10:37 +02:00
Daniel Kolesa 1f4f7e8597 eolian: cycle checks for all toplevel decls in static analyzer
This is necessary because e.g. typedecls can introduce cycles into
the system by self-referencing in struct field expressions.
2018-05-13 17:06:12 +02:00
Daniel Kolesa a923a94f85 eolian: always validate entire staging area
This is necessary even when parsing a single file because there
may be parsed results directly in the staging area introduced by
doc references, those wouldn't get correctly validated and would
be left in an inconsistent and unusable state.
2018-05-13 17:06:12 +02:00
Daniel Kolesa e50aa5e1c9 eolian: check does no changes, so take a const state 2018-05-13 17:06:12 +02:00
Daniel Kolesa 95e3468aee eolian: introduce initial out-of-validation static checking
For now this checks for validity of explicitly imported
dependencies in eo/eot files. It will warn if the dependency
is unused.
2018-05-11 14:02:36 +02:00
Daniel Kolesa 3685bcd61d eolian: add optional warnings about events missing a type
Set the EOLIAN_EVENT_NO_TYPE_WARN environment variable to enable
those warnings during Eolian usage. They will be considered a part
of the validation then.

Use the void type for events to suppress the warning.
2018-05-09 15:44:36 +02:00
Daniel Kolesa 3a55fe0bbf eolian: allow void and non-ownable types in future 2018-05-03 17:14:39 +02:00
Daniel Kolesa c116695311 eolian: add builtin type for Eina_Future 2018-05-03 17:14:39 +02:00
Daniel Kolesa 0a399be7b0 eolian: add source file for the future static checker 2018-05-03 17:14:39 +02:00
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