Commit Graph

58 Commits

Author SHA1 Message Date
Daniel Kolesa 7c7e5ec423 eolian: validate inner types of complex types
This makes sure the inner types are all correctly defined and
that freefuncs are actually correctly filled.
2017-09-28 23:22:05 +02:00
Daniel Kolesa 9009d3dae4 eolian: add any_value_ptr
Because pointer Eina_Values and value Eina_Values have slightly
different semantics (when it comes to resource management) it's
better to split them.
2017-09-22 20:25:31 +02:00
Daniel Kolesa 3d8081d085 eolian: rename generic_value to any_value 2017-09-22 20:16:06 +02:00
Daniel Kolesa a6e5caba10 eolian: remove leftover code 2017-09-22 18:08:36 +02:00
Daniel Kolesa 1577c576e6 eolian: remove static_array and terminated_array
These types are of questionable value and the API was not entirely
thought out - remove for now, and if a legitimate use is found
later, they may be readded (with a better API), but typically it
seems best to redesign the bad APIs around safe containers...
2017-09-22 18:01:15 +02:00
Daniel Kolesa 4bae2a7385 eolian: merge REGULAR and COMPLEX types 2017-09-22 17:46:02 +02:00
Daniel Kolesa fdd27cadf8 eo: make more freefuncs implicit 2017-09-22 16:17:19 +02:00
Daniel Kolesa 21213802e4 eolian: switch validation to new ownership system 2017-09-15 16:37:26 +02:00
Daniel Kolesa 518ca72d06 eolian: default free funcs for builtin types 2017-09-14 15:53:30 +02:00
Daniel Kolesa 59347d4c4b eolian: include terminatable checks in ownable check 2017-09-14 00:28:32 +02:00
Daniel Kolesa 8ff2bf35fe eolian: inherit freefunc between types/typedecls 2017-09-14 00:12:46 +02:00
Daniel Kolesa 2a9be1f5be eolian: move terminated_array typecheck to validate pass 2017-09-13 23:58:47 +02:00
Daniel Kolesa a0adca9cb9 eolian: move ownable checks to validation stage 2017-09-13 23:58:47 +02:00
Lauro Moura 1634c14169 eolian: function pointers
First steps toward explicit function pointer support in eolian.

To declare a function pointer type, use the following syntax, similar to
a regular eolian method declaration.

function FunctionName {
  params {
    ...
  }
  return: Return type
}
2017-06-18 12:09:22 -03:00
Daniel Kolesa a5e66b3421 eolian: doc token ref resolver now takes unit 2017-05-30 17:15:54 +02:00
Daniel Kolesa 81a1d9659a eolian: type_class_get takes unit 2017-05-30 17:15:54 +02:00
Daniel Kolesa c234b5ee69 eolian: expr eval APIs now take units 2017-05-30 17:15:54 +02:00
Daniel Kolesa 9699d074bc eolian: pass unit to all_classes_get 2017-05-30 17:15:53 +02:00
Daniel Kolesa 5411dba596 eolian: add implement validation (currently for docs) 2017-01-19 15:09:07 +01:00
Daniel Kolesa 95181f2d36 eolian: move base function doc API into implements
This allows us to unify retrieval of docs for both regular and
overridden funcs without having two separate APIs. It's currently
missing validation and docgen is still not adjusted properly for
it either, but at least there's this. Enables retrieval of docs
for overridden funcs by default as well.
2017-01-19 15:09:07 +01:00
Daniel Kolesa 3dfb7a6ba8 eolian: enable typechecked expression validation
This code was formerly disabled, but it's safe now.
2016-12-15 13:31:58 +01:00
Daniel Kolesa 246288fff7 eolian: forgotten free() (leaks memory otherwise) 2016-12-07 14:06:02 +01:00
Daniel Kolesa 5fa81d9fab eolian: switch reference validation to new tokenizer 2016-12-07 13:56:35 +01:00
Daniel Kolesa 8002b3b24e eolian: remove parsing of pointers and the corresponding APIs
Everything should be done via the new ptr() system now.
2016-11-10 16:20:19 +01:00
Daniel Kolesa 82ef73ca18 eolian: remove type silencing stuff entirely
this was useful during transition, but not anymore
2016-10-25 18:02:23 +02:00
Daniel Kolesa ab2e608239 eolian: add support for static and terminated arrays
Adds two new type types, STATIC_ARRAY and TERMINATED_ARRAY. Static arrays are
only allowed as struct members right now - they translate to regular C static
arrays (allowing them elsewhere wouldn't be good, as C isn't very good at
working with the size information). Terminated arrays are basically sequences
of data terminated at the end. The base type of static arrays can be any type
that is not marked ref (explicit ref may get allowed later). The base type of
terminated arrays has the same restriction plus that it has to be either
implicitly reference type (i.e. translating to pointer in C), integer type
or a character. In case of ref types, the terminator is NULL. In case of
integer types, the terminator is a zero. In case of character types, the
terminator is also a zero (null terminator like C strings).

@feature
2016-06-30 16:59:21 +01:00
Tom Hacohen cfd7b57006 Eolian: Turn on strict type checking.
Thanks to q66 for the code.
I'm stealing credit here because:
1. I'm lazy.
2. He's lazy and doesn't deserve it.
2016-04-19 17:15:28 +01:00
Daniel Kolesa e061d49aac eolian: completely clean up the type system 2016-03-03 18:58:11 +00:00
Daniel Kolesa 4c4fbfae0b eolian: remove most of the old type APIs 2016-03-03 18:58:11 +00:00
Daniel Kolesa 4e40b60f06 eolian: remove retrieval funcs for type-style enums/aliases/structs 2016-03-03 18:58:11 +00:00
Daniel Kolesa eee5cc4fdc eolian: re-enable strict validation 2016-02-18 10:14:41 +00:00
Cedric BAIL 56a21ab5f2 Revert "eolian: strict validation for EFL (errors by default)"
This reverts commit 21a2a8007d.

Please run make check from time to time.
2016-02-17 14:37:42 -08:00
Daniel Kolesa 21a2a8007d eolian: strict validation for EFL (errors by default) 2016-02-17 13:00:41 +00:00
Daniel Kolesa 2998da56e3 eolian: verbose type warnings for EFL by default 2016-02-16 15:13:02 +00:00
Daniel Kolesa 30bc1d285b eolian: allow silencing of type errors in validation
This allows generators to silence type errors in validation in order
to reduce duplicate error messages when generating multiple files.
Also adjusted the C generator to only emit type errors when generating
Eo header files.

@feature
2016-02-10 16:05:07 +00:00
Daniel Kolesa b3867ce395 eolian: turn "undefined type" into its own EOLIAN_TYPE 2015-11-19 14:05:16 +00:00
Daniel Kolesa 26d0053a0f eolian: do not treat @since specially in validation (not needed) 2015-08-06 17:04:06 +01:00
Daniel Kolesa b2bfd64f26 eolian: different error for validating @since 2015-07-31 15:55:24 +01:00
Daniel Kolesa e805dcd370 eolian: enable the new doc validator
This will make Eolian error when the input documentation
is in a wrong format.
2015-07-08 15:51:29 +01:00
Daniel Kolesa 69cccd043a eolian: print more detailed location info for doc validation 2015-07-08 14:47:09 +01:00
Daniel Kolesa b5141e6291 eolian: correct documentation ref validation (disabled for now) 2015-07-08 13:39:46 +01:00
Daniel Kolesa 70b7043731 eolian: initial work on doc syntax validation (disabled for now) 2015-07-07 15:21:45 +01:00
Daniel Kolesa 660e23fd75 eolian: add new __undefined_type builtin to silence warnings 2015-06-10 16:56:37 +01:00
Daniel Kolesa 6b91b1bd12 eolian: allow keys/values in property get/set
Sometimes it is necessary to specify a different set of values for a
getter or a setter. This commit allows such specializations. This also
renders @const_get and @const_set useless (soon to be removed).

To function correctly, this required adjustment of several public APIs
as well as deprecation of eolian_function_parameter_get_by_name.

This function was not used in any generator and was pretty much
useless in the first place, so it was removed.

@fix
2015-05-20 17:42:44 +01:00
Daniel Kolesa ed58165b50 eolian: butts 2015-05-12 16:25:52 +01:00
Daniel Kolesa 4a14bbd0f5 eolian: fix unary expression parsing (correctly consume tokens)
Also disable typed expression validation for now. The interfaces are not
finished yet so some things will fail validation because of unexistent
type definitions.

Fixes T2064.

@fix
2015-01-29 11:12:41 +00:00
Daniel Kolesa 5b9ece9c85 eolian: remove support for function types
These won't be needed because of Eo callbacks. They're also difficult
to handle in bindings, so this will relieve bindings of some effort.
2014-11-27 17:20:21 +00:00
Mike Blumenkrantz 5375e154fe fix config.h inclusion across the tree 2014-09-23 15:56:46 -04:00
Daniel Kolesa 7786b96359 eolian: builtin complex types
From now on, there are 5 builtin complex types, particularly accessor, array,
iterator, hash and list. All other types are simple - they can't have a complex
part. Also, the <> now binds to the type itself, not the pointer. More builtin
complex types will be added as needed.
2014-09-08 14:53:13 +01:00
Daniel Kolesa 231b2f3044 eolian: enum validation fix 2014-09-02 12:39:58 +01:00