Commit Graph

82 Commits

Author SHA1 Message Date
Avi Kivity
6572b297a2 treewide: clean up stray license blurbs
After the mechanical change in fcb8d040e8
("treewide: use Software Package Data Exchange (SPDX) license identifiers"),
a few stray license blurbs or fragments thereof remain. In two cases
these were extra blurbs in code generators intended for the generated code,
in others they were just missed by the script.

Clean them up, adding an SPDX license identifier where needed.

Closes #10072
2022-02-13 14:16:16 +02:00
Avi Kivity
fcb8d040e8 treewide: use Software Package Data Exchange (SPDX) license identifiers
Instead of lengthy blurbs, switch to single-line, machine-readable
standardized (https://spdx.dev) license identifiers. The Linux kernel
switched long ago, so there is strong precedent.

Three cases are handled: AGPL-only, Apache-only, and dual licensed.
For the latter case, I chose (AGPL-3.0-or-later and Apache-2.0),
reasoning that our changes are extensive enough to apply our license.

The changes we applied mechanically with a script, except to
licenses/README.md.

Closes #9937
2022-01-18 12:15:18 +01:00
Gleb Natapov
2aedf79152 idl-compiler: remove no longer used variable
types_with_const_appearances is no longer used. Remove it.

Message-Id: <YeUnoZXNcW0AdWWK@scylladb.com>
2022-01-17 10:30:30 +02:00
Gleb Natapov
dc886d96d1 idl-compiler: update the documentation with new features added recently
The series to move storage_proxy verbs to the IDL added not features to
the IDL compiler, but was lacking a documentation. This patch documents
the features.
2022-01-16 15:12:07 +02:00
Gleb Natapov
b0dee71b34 idl-compiler: always produce const variant of serializers
Currently const variant is produced only if a type and its const usage
are in the same idl file, but a type can be defined in one file and used
as const in another.
2022-01-13 13:14:46 +02:00
Gleb Natapov
c998f77cd2 idl-compiler: allow const references in send() parameter list
Currently send function parameters and rpc handler's function parameters
have both to be values, but sometimes we want send function to receive a
const reference to a value to avoid copying, but a handler still needs
to get it by value obviously. Support that by introducing one more type
attribute [[ref]]. If present the code generator makes send function
argument to look like 'const type&' and handler's argument will be
'type'.
2022-01-10 14:44:20 +02:00
Gleb Natapov
f3d5507f86 idl-compiler: support smart pointers in verb's return value
A verb's handler may return a 'foreign_ptr<smart_ptr<type>>' value which
is received on a client side as a naked 'type'. Current verb generator
code can only support symmetric handler/send helper where return type pf
a handler matches return type of a send function. Fix that by adding two
new attributes that can annotate a return type: unique_ptr,
lw_shared_ptr. If unique_ptr attribute is present the return type of a
handler will be 'foreign_ptr<unique_ptr<type>>' and the return type of a
send function will be just 'type'.
2022-01-10 14:29:37 +02:00
Gleb Natapov
9329234941 idl-compiler: support multiple return value and optional in a return value
RPC verbs can be extended to return more then one value and new values
are returned as rpc::optional. When adding a return value to a verb
its return values becomes rpc::tuple<type1, type2, type3>. In addition
new return values may be marked as rpc::optional for backwards
compatibility. The patch allow to part return expression of the form:
  -> type1, type2 [[version 1.1.0]]
which will be translated into:
  rpc::tuple<type1, rpc::optional<type2>>
2022-01-10 14:23:51 +02:00
Gleb Natapov
9c88ea2303 idl-compiler: handle :: at the beginning of a type
Currently types starting from '::' like '::ns::type' cause parsing
errors. Fix it.
2022-01-10 14:22:48 +02:00
Gleb Natapov
cf8c42ee42 idl-compiler: sending one way message without timeout does not require ret value specialization as well 2022-01-10 14:16:20 +02:00
Pavel Solodovnikov
88f9f2e9d0 idl: support generating boilerplate code for RPC verbs
Introduce new syntax in IDL compiler to allow generating
registration/sending code for RPC verbs:

        verb [[attr1, attr2...] my_verb (args...) -> return_type;

`my_verb` RPC verb declaration corresponds to the
`netw::messaging_verb::MY_VERB` enumeration value to identify the
new RPC verb.

For a given `idl_module.idl.hh` file, a registrator class named
`idl_module_rpc_verbs` will be created if there are any RPC verbs
registered within the IDL module file.

These are the methods being created for each RPC verb:

        static void register_my_verb(netw::messaging_service* ms, std::function<return_type(args...)>&&);
        static future<> unregister_my_verb(netw::messaging_service* ms);
        static future<> send_my_verb(netw::messaging_service* ms, netw::msg_addr id, args...);

Each method accepts a pointer to an instance of `messaging_service`
object, which contains the underlying seastar RPC protocol
implementation, that is used to register verbs and pass messages.

There is also a method to unregister all verbs at once:

        static future<> unregister(netw::messaging_service* ms);

The following attributes are supported when declaring an RPC verb
in the IDL:
* [[with_client_info]] - the handler will contain a const reference to
  an `rpc::client_info` as the first argument.
* [[with_timeout]] - an additional `time_point` parameter is supplied
  to the handler function and `send*` method uses `send_message_*_timeout`
  variant of internal function to actually send the message.
* [[one_way]] - the handler function is annotated by
  `future<rpc::no_wait_type>` return type to designate that a client
  doesn't need to wait for an answer.

The `-> return_type` clause is optional for two-way messages. If omitted,
the return type is set to be `future<>`.
For one-way verbs, the use of return clause is prohibited and the
signature of `send*` function always returns `future<>`.

No existing code is affected.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2021-09-30 02:21:57 +03:00
Pavel Solodovnikov
02f27260cc idl: allow specifying multiple attributes in the grammar
This patch extends the IDL grammar by allowing to use
multiple `[[...]]` attribute clauses, as well, as specifying
more than one attribute inside a single attribute clause, e.g.:
`[[attr1, attr2]]` will be parsed correctly now.

For now, in all existing use cases only the first attribute
is taken into account and the rest is ignored.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2021-09-15 17:47:27 +03:00
Pavel Solodovnikov
ebee744590 idl-compiler: make the script work with python 3.8
Python 3.8 doesn't allow to use built-in collection types
in type annotations (such as `list` or `dict`).
This feature is implemented starting from 3.9.

Replace `list[str]` type annotation with an old-style
`List[str]`, which uses `List` from the `typing` module.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
Message-Id: <20210901131436.35231-1-pa.solodovnikov@scylladb.com>
2021-09-02 15:38:44 +03:00
Pavel Solodovnikov
718977e2b7 idl: add descriptions for the top-level generation routines
Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2021-07-21 15:39:20 +03:00
Pavel Solodovnikov
fe6b0e8bbf idl: make ns_qualified name a class method
Introduce ASTBase and move `combine_ns` and `ns_qualified_name`
there.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2021-07-21 15:31:47 +03:00
Pavel Solodovnikov
c584bbf841 idl: cache template declarations inside enums and classes
Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2021-07-21 15:17:40 +03:00
Pavel Solodovnikov
82cb2dc3e3 idl: cache parent template params for enums and classes
Also remove `parent_template_param` argument for
`handle_enum` and `handle_class` functions.

`setup_namespace_bindings` is renamed to `setup_additional_metadata`
since it now also sets parent template arguments for each object.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2021-07-21 15:17:40 +03:00
Pavel Solodovnikov
6dd3bf9d6d idl: rename misleading local_types to local_writable_types
Rename `add_to_types` function to `register_local_writable_type`
and `local_types` set to `local_writable_types`.
Also rename other related functions accordingly, by adding
`writable` to the names.

Previous names were misleading since `local_types` refers not
to all local types but only to those which are marked with
`[[writable]]` attribute.

Nonetheless, we are going to need a mapping of all local types
to resolve type references from `BasicType` AST node
instances. So the `local_types` set is retained, but now it
corresponds to the list of all local types.

Tests: unit(dev)

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2021-07-21 15:17:40 +03:00
Pavel Solodovnikov
d17a6a5e5a idl: remove remaining uses of namespaces argument
Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2021-07-21 15:17:40 +03:00
Pavel Solodovnikov
8aeaba5eb6 idl: remove is_final function and use .final AST class property
Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2021-07-21 15:17:40 +03:00
Pavel Solodovnikov
5ec8aeb74c idl: remove parent_template_param from local_types set
Previously local types set contained a items, which are lists
of `[cls, parent_template_param]`. The second element is never
used, so remove it and move `cls` from the list.

All uses are adjusted accordingly.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2021-07-21 15:17:40 +03:00
Pavel Solodovnikov
4a66e07cb1 idl: cache namespaces in AST nodes
Do a pre-processing pass to cache namespaces info in each
type declaration AST node (`ClassDef` and `EnumDef`) and
store it in the `ns_context` field of a node.

Switch to `ns_context` and eliminate `namespaces` parameter
carried over through all writer functions.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2021-07-21 15:17:39 +03:00
Pavel Solodovnikov
3218a952b9 idl: remove unused variables
This patch removes unused `parent_template_param` and `namespaces`
variables obtained from unpacking values from the `local_types` set.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2021-07-21 15:17:39 +03:00
Avi Kivity
a55b434a2b treewide: extent copyright statements to present day 2021-06-06 19:18:49 +03:00
Wojciech Mitros
88e750f379 idl-compiler: allow fields of type utils::chunked_vector
The utils::chunked_vector has practically the same methods
as a std::vector, so the same code can be generated for it.

Signed-off-by: Wojciech Mitros <wojciech.mitros@scylladb.com>
2021-01-13 04:09:18 +01:00
Pavel Solodovnikov
3a91f1127d idl: move enum and class serializer code writers to the corresponding AST classes
Expand the role of AST classes to also supply methods for actually
generating the code. More changes will follow eventually until
all generation code is handled by these classes.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2020-12-22 23:23:12 +03:00
Pavel Solodovnikov
edf9ccee48 idl: extract writer functions for write, read and skip impls for classes and enums
Split `write`, `read` and `skip` serializer function writers to
separate functions in `handle_class` and `handle_enum` functions,
which slightly improves readability.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2020-12-16 20:33:55 +03:00
Pavel Solodovnikov
8049cb0f91 idl: minor fixes and code simplification
* Introduce `ns_qualified_name` and `template_params_str` functions
  to simplify code a little bit in `handle_enum` and `handle_class`
  functions.
* Previously each serializer had a separate namespace open-close
  statements, unify them into a single namespace scope.
* Fix a few more `hout` -> `cout` argument names.
* Rename `template` pattern to `template_decl` to improve clarity.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2020-12-16 19:32:08 +03:00
Pavel Solodovnikov
0de96426db idl: change argument name from hout to cout in all dependencies of add_visitors fn
Prior to the patch all functions that are called from `add_visitors`
and this function itself declared the argument denoting the output
file as `hout`. Though, this was quite misleading since `hout`
is meant to be header file with declarations, while `cout` is an
implementation file.

These functions write to implmentation file hence `hout` should
be changed to `cout` to avoid confusion.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2020-12-16 19:32:03 +03:00
Pavel Solodovnikov
0defb52855 idl: fix parsing of basic types and discard unneeded terminals
Prior to the patch `btype` production was using `with_colon`
rule, which accidentally supported parsing both numbers and
identifiers (along with other invalid inputs, such as "123asd").

It was changed to use `ns_qualified_ident` and those places
which can accept numeric constants, are explicitly listing
it as an alternative, e.g. template parameter list.

Unfortunately, I had to make TemplateType to explicitly construct
`BasicType` instances from numeric constants in template arguments
list. This is exactly the way it was handled before, though.

But nonetheless, this should be addressed sometime later.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2020-12-16 19:31:57 +03:00
Pavel Solodovnikov
0cc87ead3d idl: remove unused functions
Remove the following functions since they are not used:
* `open_namespaces`
* `close_namespaces`
* `flat_template`

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2020-12-16 19:31:51 +03:00
Pavel Solodovnikov
bea965a0a7 idl: improve error tracing in the grammar and tighten-up some grammar rules
This patch replaces use of some handwritten rules to use their
alternatives already defined in `pyparsing.pyparsing_common`
class, i.e.: `number`, `identifier` productions.

Changed ignore patterns for comments to use pre-defined
`pp.cppStyleComment` instead of hand-written combination of
'//'-style and C-style comment rules.

Operator '-' is now used whenever possible to improve debugging
experience: it disables default backtracking for productions
so that compiler fails earlier and can now point more precisely
to a place in the input string where it failed instead of
backtracking to the top-level rule and reporting error there.

Template names and class names now use `ns_qualified_ident`
rule instead of `with_colon` which prevents grammar from
matching invalid identifiers, such as `std:vector`.

Many places are using the updated `identifier` production, which
is working correctly unlike its predecessor: now inputs
such as `1ident` are considered invalid.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2020-12-16 19:31:46 +03:00
Pavel Solodovnikov
3a037bc5b6 idl: remove redundant set_namespace function
Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2020-12-16 19:31:40 +03:00
Pavel Solodovnikov
e76e8aec0e idl: remove unused declare_class function
Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2020-12-16 19:31:35 +03:00
Pavel Solodovnikov
745f4ac23b idl: slightly change str and repr for AST types
Surround string representation with angle brackets. This improves
readability when printing debug output.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2020-12-16 19:31:20 +03:00
Pavel Solodovnikov
4a61270701 idl: place directly executed init code into if __name__=="__main__"
Since idl compiler is not intended to be used as a module to other
python build scripts, move initialization code under an if checking
that current module name is "__main__".

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2020-12-16 19:30:33 +03:00
Pavel Solodovnikov
8b8dce15c3 idl: add docstrings for AST classes
Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2020-12-16 09:03:39 +03:00
Pavel Solodovnikov
facf27dbe4 idl: allow to parse const specifiers for template arguments
This patch introduces very limited support for declaring `const`
template parameters in data members.

It's not covering all the cases, e.g.
`const type member_variable` and `const template_def<T1, T2, ...>`
syntax is not supported at the moment.

Though the changes are enough for raft-related use: this makes it
possible to declare `std::vector<raft::log_entries_ptr>` (aka
`std::vector<lw_shared_ptr<const raft::log_entry>>`) in the IDL.

Existing IDL files are not affected in any way.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2020-12-15 16:03:11 +03:00
Pavel Solodovnikov
f02703fcd7 idl: fix a few typos in idl-compiler
Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2020-12-15 16:02:55 +03:00
Pavel Solodovnikov
28b602833f idl: switch from string.Template to python f-strings and format string in idl-compiler
Move to a modern and lightweight syntax of f-strings
introduced in python 3.6. It improves readability and provides
greater flexibility.

A few places are now using format strings instead, though.

In case when multiline substitution variable is used, the template
string should be first re-indented and only after that the
formatting should be applied, or we can end up with screwed
indentation the in generated sources.

This change introduces one invisible whitespace change
in `query.dist.impl.hh`, otherwise all generated code is exactly
the same.

Tests: build(dev) and diff genetated IDL sources by hand

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2020-12-15 16:01:17 +03:00
Pavel Solodovnikov
4ab1f7f55d idl: Decouple idl-compiler data structures from grammar structure
Instead of operating on the raw lists of tokens, transform them into
typed structures representation, which makes the code by many orders of
magnitude simpler to read, understand and extend.

This includes sweeping changes throughout the whole source code of the
tool, because almost every function was tightly coupled to the way
data was passed down from the parser right to the code generation
routines.

Tested manually by checking that old generated sources are precisely
the same as the new generated sources.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2020-12-15 15:59:17 +03:00
Avi Kivity
a99aba9e48 idl-compiler: generate views after serializers
Clang eagerly instantiates templates, so if it needs a template
function for which it has a declaration but not a definition, it
will not instantiate the definition when it sees it. This causes
link errors.

In this case, the views use the serializer implementations, but are
generated before them.

Fix by generating the view implementations after the serializer
implementations that they use.
2020-10-03 19:56:25 +03:00
Avi Kivity
a4c44cab88 treewide: update concepts language from the Concepts TS to C++20
Seastar recently lost support for the experimental Concepts Technical
Specification (TS) and gained support for C++20 concepts. Re-enable
concepts in Scylla by updating our use of concepts to the C++20
standard.

This change:
 - peels off uses of the GCC6_CONCEPT macro
 - removes inclusions of <seastar/gcc6-concepts.hh>
 - replaces function-style concepts (no longer supported) with
   equation-style concepts
 - semicolons added and removed as needed
 - deprecated std::is_pod replaced by recommended replacement
 - updates return type constraints to use concepts instead of
   type names (either std::same_as or std::convertible_to, with
   std::same_as chosen when possible)

No attempt is made to improve the concepts; this is a specification
update only.
Message-Id: <20200531110254.2555854-1-avi@scylladb.com>
2020-06-02 09:12:21 +03:00
Botond Dénes
838b92f4b0 idl-compiler.py: don't use 'is not' for string comparison
In python, `is` and `is not` checks object identity, not value
equivalence, yet in `idl-compiler.py` it is used to compare strings.
Newer python versions (that shipped in Fedora32) complains about this
misuse, so this patch fixes it.

Tests: unit(dev)
Signed-off-by: Botond Dénes <bdenes@scylladb.com>
Message-Id: <20200526091811.50229-1-bdenes@scylladb.com>
2020-05-27 08:40:05 +03:00
Rafael Ávila de Espíndola
72e900291b build: Make the output of idl-compiler deterministic
If at any point during the topological sort we had more than one node
with zero dependencies, the order they were printed was not
deterministic.

Signed-off-by: Rafael Ávila de Espíndola <espindola@scylladb.com>
2020-01-22 16:28:00 -08:00
Duarte Nunes
fa2b0384d2 Replace std::experimental types with C++17 std version.
Replace stdx::optional and stdx::string_view with the C++ std
counterparts.

Some instances of boost::variant were also replaced with std::variant,
namely those that called seastar::visit.

Scylla now requires GCC 8 to compile.

Signed-off-by: Duarte Nunes <duarte@scylladb.com>
Message-Id: <20190108111141.5369-1-duarte@scylladb.com>
2019-01-08 13:16:36 +02:00
Alexys Jacob
14e65e1089 idl-compiler.py: python3 shebang 2018-11-28 23:58:38 +01:00
Alexys Jacob
e58eb6d6ab idl-compiler.py: coding style fixes
idl-compiler.py:22:1: F401 'json' imported but unused
idl-compiler.py:23:1: F401 'sys' imported but unused
idl-compiler.py:24:1: F401 're' imported but unused
idl-compiler.py:25:1: F401 'glob' imported but unused
idl-compiler.py:27:1: F401 'os' imported but unused
idl-compiler.py:54:1: F811 redefinition of unused 'reindent' from line 33
idl-compiler.py:57:1: E302 expected 2 blank lines, found 1
idl-compiler.py:61:1: E302 expected 2 blank lines, found 1
idl-compiler.py:66:1: E302 expected 2 blank lines, found 1
idl-compiler.py:96:1: E302 expected 2 blank lines, found 1
idl-compiler.py:160:1: E302 expected 2 blank lines, found 1
idl-compiler.py:163:1: E302 expected 2 blank lines, found 1
idl-compiler.py:166:1: E302 expected 2 blank lines, found 1
idl-compiler.py:172:1: E302 expected 2 blank lines, found 1
idl-compiler.py:176:1: E302 expected 2 blank lines, found 1
idl-compiler.py:176:47: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:176:49: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:191:24: E203 whitespace before ':'
idl-compiler.py:191:43: E203 whitespace before ':'
idl-compiler.py:191:67: E203 whitespace before ':'
idl-compiler.py:191:84: E202 whitespace before '}'
idl-compiler.py:195:1: E302 expected 2 blank lines, found 1
idl-compiler.py:195:45: E203 whitespace before ','
idl-compiler.py:195:69: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:195:71: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:198:28: E225 missing whitespace around operator
idl-compiler.py:198:40: E225 missing whitespace around operator
idl-compiler.py:198:43: E272 multiple spaces before keyword
idl-compiler.py:212:25: E203 whitespace before ':'
idl-compiler.py:212:45: E203 whitespace before ':'
idl-compiler.py:212:100: E203 whitespace before ':'
idl-compiler.py:218:1: E302 expected 2 blank lines, found 1
idl-compiler.py:225:1: E302 expected 2 blank lines, found 1
idl-compiler.py:226:11: E271 multiple spaces after keyword
idl-compiler.py:228:1: E302 expected 2 blank lines, found 1
idl-compiler.py:235:1: E302 expected 2 blank lines, found 1
idl-compiler.py:238:1: E302 expected 2 blank lines, found 1
idl-compiler.py:241:5: E722 do not use bare 'except'
idl-compiler.py:243:1: E305 expected 2 blank lines after class or function
definition, found 0
idl-compiler.py:245:1: E302 expected 2 blank lines, found 1
idl-compiler.py:250:25: E231 missing whitespace after ','
idl-compiler.py:253:1: E302 expected 2 blank lines, found 1
idl-compiler.py:256:1: E302 expected 2 blank lines, found 1
idl-compiler.py:263:1: E302 expected 2 blank lines, found 1
idl-compiler.py:266:1: E302 expected 2 blank lines, found 1
idl-compiler.py:267:75: E225 missing whitespace around operator
idl-compiler.py:269:1: E302 expected 2 blank lines, found 1
idl-compiler.py:272:1: E302 expected 2 blank lines, found 1
idl-compiler.py:275:1: E302 expected 2 blank lines, found 1
idl-compiler.py:278:1: E305 expected 2 blank lines after class or function
definition, found 1
idl-compiler.py:280:1: E302 expected 2 blank lines, found 1
idl-compiler.py:283:1: E302 expected 2 blank lines, found 1
idl-compiler.py:286:1: E302 expected 2 blank lines, found 1
idl-compiler.py:288:1: E302 expected 2 blank lines, found 0
idl-compiler.py:293:1: E302 expected 2 blank lines, found 1
idl-compiler.py:294:20: E203 whitespace before ':'
idl-compiler.py:294:22: E241 multiple spaces after ':'
idl-compiler.py:294:51: E203 whitespace before ':'
idl-compiler.py:294:55: E202 whitespace before '}'
idl-compiler.py:296:1: E302 expected 2 blank lines, found 1
idl-compiler.py:298:23: E203 whitespace before ':'
idl-compiler.py:300:1: E305 expected 2 blank lines after class or function
definition, found 1
idl-compiler.py:301:1: E302 expected 2 blank lines, found 0
idl-compiler.py:304:1: E302 expected 2 blank lines, found 1
idl-compiler.py:304:45: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:304:47: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:311:67: E202 whitespace before '}'
idl-compiler.py:314:74: E241 multiple spaces after ':'
idl-compiler.py:316:114: E241 multiple spaces after ':'
idl-compiler.py:316:129: E203 whitespace before ':'
idl-compiler.py:326:1: E302 expected 2 blank lines, found 1
idl-compiler.py:328:27: E231 missing whitespace after ','
idl-compiler.py:328:34: E225 missing whitespace around operator
idl-compiler.py:330:1: E302 expected 2 blank lines, found 1
idl-compiler.py:332:5: F841 local variable 'typ' is assigned to but never used
idl-compiler.py:348:63: E202 whitespace before '}'
idl-compiler.py:352:1: E302 expected 2 blank lines, found 1
idl-compiler.py:353:21: E231 missing whitespace after ','
idl-compiler.py:368:30: E203 whitespace before ':'
idl-compiler.py:374:30: E203 whitespace before ':'
idl-compiler.py:411:57: E203 whitespace before ':'
idl-compiler.py:413:1: E302 expected 2 blank lines, found 1
idl-compiler.py:413:64: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:413:66: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:413:80: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:413:82: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:413:98: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:413:100: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:415:51: E225 missing whitespace around operator
idl-compiler.py:417:57: E225 missing whitespace around operator
idl-compiler.py:448:1: E302 expected 2 blank lines, found 1
idl-compiler.py:448:60: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:448:62: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:448:76: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:448:78: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:448:94: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:448:96: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:451:51: E225 missing whitespace around operator
idl-compiler.py:453:57: E225 missing whitespace around operator
idl-compiler.py:455:30: E231 missing whitespace after ','
idl-compiler.py:477:1: E302 expected 2 blank lines, found 1
idl-compiler.py:477:48: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:477:50: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:477:67: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:477:69: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:484:24: E222 multiple spaces after operator
idl-compiler.py:488:74: E203 whitespace before ':'
idl-compiler.py:498:20: E222 multiple spaces after operator
idl-compiler.py:507:68: E203 whitespace before ':'
idl-compiler.py:507:88: E203 whitespace before ':'
idl-compiler.py:514:87: E231 missing whitespace after ','
idl-compiler.py:520:14: E211 whitespace before '('
idl-compiler.py:521:15: E703 statement ends with a semicolon
idl-compiler.py:523:1: E302 expected 2 blank lines, found 1
idl-compiler.py:540:47: E231 missing whitespace after ':'
idl-compiler.py:542:1: E302 expected 2 blank lines, found 1
idl-compiler.py:542:47: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:542:49: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:542:69: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:542:71: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:547:24: E222 multiple spaces after operator
idl-compiler.py:553:47: E231 missing whitespace after ':'
idl-compiler.py:558:43: E231 missing whitespace after ':'
idl-compiler.py:560:1: E302 expected 2 blank lines, found 1
idl-compiler.py:564:1: E302 expected 2 blank lines, found 1
idl-compiler.py:564:82: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:564:84: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:564:105: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:564:107: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:573:21: E222 multiple spaces after operator
idl-compiler.py:576:25: E222 multiple spaces after operator
idl-compiler.py:577:13: F841 local variable 'sate' is assigned to but never
used
idl-compiler.py:584:66: E203 whitespace before ':'
idl-compiler.py:589:66: E203 whitespace before ':'
idl-compiler.py:589:89: E203 whitespace before ':'
idl-compiler.py:589:113: E203 whitespace before ':'
idl-compiler.py:600:48: E203 whitespace before ':'
idl-compiler.py:600:68: E203 whitespace before ':'
idl-compiler.py:602:1: E302 expected 2 blank lines, found 1
idl-compiler.py:602:1: F811 redefinition of unused 'add_vector_node' from line
330
idl-compiler.py:604:38: E231 missing whitespace after ','
idl-compiler.py:604:59: E202 whitespace before ')'
idl-compiler.py:607:1: E305 expected 2 blank lines after class or function
definition, found 1
idl-compiler.py:609:1: E302 expected 2 blank lines, found 1
idl-compiler.py:615:39: E231 missing whitespace after ','
idl-compiler.py:622:1: E302 expected 2 blank lines, found 1
idl-compiler.py:630:46: E203 whitespace before ':'
idl-compiler.py:637:33: E231 missing whitespace after ':'
idl-compiler.py:640:90: E203 whitespace before ':'
idl-compiler.py:641:13: F841 local variable 'vr' is assigned to but never used
idl-compiler.py:642:1: E305 expected 2 blank lines after class or function
definition, found 0
idl-compiler.py:644:1: E302 expected 2 blank lines, found 1
idl-compiler.py:657:1: E302 expected 2 blank lines, found 1
idl-compiler.py:657:51: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:657:53: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:657:67: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:657:69: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:660:5: E265 block comment should start with '# '
idl-compiler.py:679:16: E272 multiple spaces before keyword
idl-compiler.py:692:56: E271 multiple spaces after keyword
idl-compiler.py:695:5: F841 local variable 'is_param_vector' is assigned to
but never used
idl-compiler.py:699:1: E302 expected 2 blank lines, found 1
idl-compiler.py:699:56: E202 whitespace before ')'
idl-compiler.py:711:1: E302 expected 2 blank lines, found 1
idl-compiler.py:719:26: E201 whitespace after '{'
idl-compiler.py:730:39: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:730:41: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:733:1: E302 expected 2 blank lines, found 1
idl-compiler.py:735:21: E225 missing whitespace around operator
idl-compiler.py:738:1: E302 expected 2 blank lines, found 1
idl-compiler.py:747:1: E305 expected 2 blank lines after class or function
definition, found 1
idl-compiler.py:749:1: E302 expected 2 blank lines, found 1
idl-compiler.py:767:17: E211 whitespace before '('
idl-compiler.py:767:26: E203 whitespace before ':'
idl-compiler.py:770:5: E303 too many blank lines (2)
idl-compiler.py:777:20: E211 whitespace before '('
idl-compiler.py:777:29: E203 whitespace before ':'
idl-compiler.py:783:28: E203 whitespace before ':'
idl-compiler.py:783:44: E203 whitespace before ':'
idl-compiler.py:783:82: E203 whitespace before ':'
idl-compiler.py:786:1: E302 expected 2 blank lines, found 1
idl-compiler.py:794:28: E203 whitespace before ':'
idl-compiler.py:802:33: E203 whitespace before ':'
idl-compiler.py:815:21: E126 continuation line over-indented for hanging
indent
idl-compiler.py:815:28: E203 whitespace before ':'
idl-compiler.py:815:50: E203 whitespace before ':'
idl-compiler.py:817:82: E203 whitespace before ':'
idl-compiler.py:817:104: E203 whitespace before ':'
idl-compiler.py:827:33: E203 whitespace before ':'
idl-compiler.py:827:48: E203 whitespace before ':'
idl-compiler.py:827:68: E203 whitespace before ':'
idl-compiler.py:827:84: E203 whitespace before ':'
idl-compiler.py:827:100: E203 whitespace before ':'
idl-compiler.py:859:24: E203 whitespace before ':'
idl-compiler.py:859:58: E203 whitespace before ':'
idl-compiler.py:859:78: E203 whitespace before ':'
idl-compiler.py:861:1: E302 expected 2 blank lines, found 1
idl-compiler.py:865:1: E302 expected 2 blank lines, found 1
idl-compiler.py:876:1: E302 expected 2 blank lines, found 1
idl-compiler.py:876:71: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:876:73: E251 unexpected spaces around keyword / parameter
equals
idl-compiler.py:883:21: E222 multiple spaces after operator
idl-compiler.py:884:28: E225 missing whitespace around operator
idl-compiler.py:884:46: E225 missing whitespace around operator
idl-compiler.py:884:49: E272 multiple spaces before keyword
idl-compiler.py:904:86: E203 whitespace before ':'
idl-compiler.py:904:107: E203 whitespace before ':'
idl-compiler.py:906:81: E203 whitespace before ':'
idl-compiler.py:906:106: E203 whitespace before ':'
idl-compiler.py:906:124: E203 whitespace before ':'
idl-compiler.py:906:143: E203 whitespace before ':'
idl-compiler.py:911:49: E203 whitespace before ':'
idl-compiler.py:911:69: E203 whitespace before ':'
idl-compiler.py:911:93: E203 whitespace before ':'
idl-compiler.py:918:85: E203 whitespace before ':'
idl-compiler.py:918:108: E203 whitespace before ':'
idl-compiler.py:918:151: E203 whitespace before ':'
idl-compiler.py:922:62: E203 whitespace before ':'
idl-compiler.py:922:90: E203 whitespace before ':'
idl-compiler.py:925:82: E203 whitespace before ':'
idl-compiler.py:925:110: E203 whitespace before ':'
idl-compiler.py:940:70: E203 whitespace before ':'
idl-compiler.py:940:128: E203 whitespace before ':'
idl-compiler.py:942:110: E203 whitespace before ':'
idl-compiler.py:942:168: E203 whitespace before ':'
idl-compiler.py:948:25: E203 whitespace before ':'
idl-compiler.py:948:75: E203 whitespace before ':'
idl-compiler.py:954:78: E203 whitespace before ':'
idl-compiler.py:954:101: E203 whitespace before ':'
idl-compiler.py:954:144: E203 whitespace before ':'
idl-compiler.py:957:62: E203 whitespace before ':'
idl-compiler.py:957:90: E203 whitespace before ':'
idl-compiler.py:969:13: E271 multiple spaces after keyword
idl-compiler.py:971:13: E271 multiple spaces after keyword
idl-compiler.py:976:1: E302 expected 2 blank lines, found 1
idl-compiler.py:987:1: E302 expected 2 blank lines, found 1
idl-compiler.py:1016:1: E302 expected 2 blank lines, found 1
idl-compiler.py:1023:42: E225 missing whitespace around operator
idl-compiler.py:1024:79: E225 missing whitespace around operator
idl-compiler.py:1027:1: E305 expected 2 blank lines after class or function
definition, found 0

Signed-off-by: Alexys Jacob <ultrabug@gentoo.org>
Message-Id: <20181104112308.19409-1-ultrabug@gentoo.org>
2018-11-14 19:25:13 +02:00
Paweł Dziepak
3b7579aa0e idl-compiler: specify return type of with_serialized_stream() lambdas
IDL-generated code uses with_serialized_stream() to optimise for cases
when the underlying buffer is not fragmented. The provided lambda will
be called with wither simple or fragmented stream as an argument. The
consequence of this is that both instantations of generic lambda need to
return the same type. This is a problem if the type is deduced and
depends on the provided input stream (e.g. different type for fragmented
and simple streams). The solution is to explictly specify the return
type as the type returned by deserialising general utils::input_stream.
This way each instantation of lambda can return whatever it wants as
long as it is convertible to the type that the serialiser would return
if utils::input_stream was given.
2018-08-24 16:07:20 +01:00
Piotr Sarna
450e014558 idl: remove for_each from fragmented serialization
Previously fragmented buffers of bytes were serialized
with a for_each loop. Since serializing bytes involves writing
size first and then data, only first fragment (and its size)
would be taken into account.
This commit changes fragmented code generation so it expects
that serialized range has a serialize(output, T) specification
and expects it to iterate over fragments on its own (just like
serializer for basic_value_view does).

Fixes #3501
2018-06-13 13:54:09 +02:00