tranp 0.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tranp-0.9.0/LICENCE +21 -0
- tranp-0.9.0/PKG-INFO +79 -0
- tranp-0.9.0/README.md +64 -0
- tranp-0.9.0/bin/_input.sh +4 -0
- tranp-0.9.0/bin/analyze.sh +7 -0
- tranp-0.9.0/bin/ast.sh +13 -0
- tranp-0.9.0/bin/cache.sh +8 -0
- tranp-0.9.0/bin/ci-test.sh +8 -0
- tranp-0.9.0/bin/gram.sh +7 -0
- tranp-0.9.0/bin/instrument.sh +29 -0
- tranp-0.9.0/bin/j2.sh +7 -0
- tranp-0.9.0/bin/test.sh +66 -0
- tranp-0.9.0/bin/transpile.sh +7 -0
- tranp-0.9.0/data/cpp/template/assign/anno_assign.j2 +5 -0
- tranp-0.9.0/data/cpp/template/assign/aug_assign.j2 +1 -0
- tranp-0.9.0/data/cpp/template/assign/move_assign.j2 +1 -0
- tranp-0.9.0/data/cpp/template/assign/move_assign_declare.j2 +7 -0
- tranp-0.9.0/data/cpp/template/assign/move_assign_destruction.j2 +1 -0
- tranp-0.9.0/data/cpp/template/assign/move_assign_dict.j2 +1 -0
- tranp-0.9.0/data/cpp/template/block/entrypoint.j2 +8 -0
- tranp-0.9.0/data/cpp/template/class/_accessor.j2 +1 -0
- tranp-0.9.0/data/cpp/template/class/_after.j2 +0 -0
- tranp-0.9.0/data/cpp/template/class/_before.j2 +0 -0
- tranp-0.9.0/data/cpp/template/class/_classify.j2 +7 -0
- tranp-0.9.0/data/cpp/template/class/_comment.j2 +1 -0
- tranp-0.9.0/data/cpp/template/class/_constructor_inherits.j2 +7 -0
- tranp-0.9.0/data/cpp/template/class/_decl_class_var.j2 +1 -0
- tranp-0.9.0/data/cpp/template/class/_decl_this_var.j2 +1 -0
- tranp-0.9.0/data/cpp/template/class/_decorators.j2 +0 -0
- tranp-0.9.0/data/cpp/template/class/_definition_class.j2 +1 -0
- tranp-0.9.0/data/cpp/template/class/_definition_enum.j2 +1 -0
- tranp-0.9.0/data/cpp/template/class/_inherits.j2 +11 -0
- tranp-0.9.0/data/cpp/template/class/_post_definition.j2 +0 -0
- tranp-0.9.0/data/cpp/template/class/_prepare.j2 +1 -0
- tranp-0.9.0/data/cpp/template/class/_statements.j2 +5 -0
- tranp-0.9.0/data/cpp/template/class/_statements_enum.j2 +12 -0
- tranp-0.9.0/data/cpp/template/class/_template_types.j2 +4 -0
- tranp-0.9.0/data/cpp/template/class/alt_class.j2 +1 -0
- tranp-0.9.0/data/cpp/template/class/class.j2 +17 -0
- tranp-0.9.0/data/cpp/template/class/enum.j2 +10 -0
- tranp-0.9.0/data/cpp/template/class/template_class.j2 +5 -0
- tranp-0.9.0/data/cpp/template/comp/_assign_dict.j2 +1 -0
- tranp-0.9.0/data/cpp/template/comp/comp_for.j2 +6 -0
- tranp-0.9.0/data/cpp/template/comp/comp_for_enumerate.j2 +2 -0
- tranp-0.9.0/data/cpp/template/comp/comp_for_range.j2 +2 -0
- tranp-0.9.0/data/cpp/template/comp/dict_comp.j2 +16 -0
- tranp-0.9.0/data/cpp/template/comp/list_comp.j2 +13 -0
- tranp-0.9.0/data/cpp/template/element/decorator.j2 +1 -0
- tranp-0.9.0/data/cpp/template/element/param_type.j2 +1 -0
- tranp-0.9.0/data/cpp/template/element/parameter.j2 +1 -0
- tranp-0.9.0/data/cpp/template/expression/argument.j2 +5 -0
- tranp-0.9.0/data/cpp/template/expression/elipsis.j2 +0 -0
- tranp-0.9.0/data/cpp/template/expression/group.j2 +1 -0
- tranp-0.9.0/data/cpp/template/flow/catch.j2 +8 -0
- tranp-0.9.0/data/cpp/template/flow/for/default.j2 +8 -0
- tranp-0.9.0/data/cpp/template/flow/for/dict.j2 +8 -0
- tranp-0.9.0/data/cpp/template/flow/for/enumerate.j2 +9 -0
- tranp-0.9.0/data/cpp/template/flow/for/range.j2 +7 -0
- tranp-0.9.0/data/cpp/template/flow/if/else.j2 +6 -0
- tranp-0.9.0/data/cpp/template/flow/if/else_if.j2 +7 -0
- tranp-0.9.0/data/cpp/template/flow/if/if.j2 +29 -0
- tranp-0.9.0/data/cpp/template/flow/try.j2 +12 -0
- tranp-0.9.0/data/cpp/template/flow/while.j2 +7 -0
- tranp-0.9.0/data/cpp/template/flow/with.j2 +2 -0
- tranp-0.9.0/data/cpp/template/flow/with_entry.j2 +2 -0
- tranp-0.9.0/data/cpp/template/func_call/__py_copy__.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/_str_format.j2 +15 -0
- tranp-0.9.0/data/cpp/template/func_call/c_func_invoke.j2 +5 -0
- tranp-0.9.0/data/cpp/template/func_call/c_func_ref.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/c_include.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/c_macro.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/c_pragma.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/c_type_expr.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/cast_bin_to_bin.j2 +10 -0
- tranp-0.9.0/data/cpp/template/func_call/cast_bin_to_str.j2 +5 -0
- tranp-0.9.0/data/cpp/template/func_call/cast_char.j2 +5 -0
- tranp-0.9.0/data/cpp/template/func_call/cast_enum.j2 +2 -0
- tranp-0.9.0/data/cpp/template/func_call/cast_list.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/cast_str_to_bin.j2 +7 -0
- tranp-0.9.0/data/cpp/template/func_call/cast_str_to_str.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/cvar_as_a.j2 +5 -0
- tranp-0.9.0/data/cpp/template/func_call/cvar_copy.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/cvar_down.j2 +5 -0
- tranp-0.9.0/data/cpp/template/func_call/cvar_move.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/cvar_new_addr.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/cvar_new_smart.j2 +5 -0
- tranp-0.9.0/data/cpp/template/func_call/cvar_new_smart_list.j2 +5 -0
- tranp-0.9.0/data/cpp/template/func_call/cvar_self_to_raw.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/cvar_smart_empty.j2 +5 -0
- tranp-0.9.0/data/cpp/template/func_call/cvar_to.j2 +9 -0
- tranp-0.9.0/data/cpp/template/func_call/cvar_to_addr_hex.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/cvar_to_addr_id.j2 +5 -0
- tranp-0.9.0/data/cpp/template/func_call/default.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/dict_copy.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/dict_get.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/dict_items.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/dict_keys.j2 +7 -0
- tranp-0.9.0/data/cpp/template/func_call/dict_pop.j2 +5 -0
- tranp-0.9.0/data/cpp/template/func_call/dict_values.j2 +7 -0
- tranp-0.9.0/data/cpp/template/func_call/generic_call.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/len.j2 +5 -0
- tranp-0.9.0/data/cpp/template/func_call/list_copy.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/list_extend.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/list_insert.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/list_pop.j2 +6 -0
- tranp-0.9.0/data/cpp/template/func_call/list_sort.j2 +16 -0
- tranp-0.9.0/data/cpp/template/func_call/print.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/str_count.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/str_encode.j2 +5 -0
- tranp-0.9.0/data/cpp/template/func_call/str_endswith.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/str_find.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/str_format.j2 +2 -0
- tranp-0.9.0/data/cpp/template/func_call/str_join.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/str_lstrip.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/str_replace.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/str_rfind.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/str_rstrip.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/str_split.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/str_startswith.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/str_strip.j2 +1 -0
- tranp-0.9.0/data/cpp/template/func_call/super.j2 +5 -0
- tranp-0.9.0/data/cpp/template/function/_accessor.j2 +9 -0
- tranp-0.9.0/data/cpp/template/function/_block.j2 +11 -0
- tranp-0.9.0/data/cpp/template/function/_block_constructor.j2 +21 -0
- tranp-0.9.0/data/cpp/template/function/_comment.j2 +1 -0
- tranp-0.9.0/data/cpp/template/function/_decorators.j2 +0 -0
- tranp-0.9.0/data/cpp/template/function/_initializer.j2 +17 -0
- tranp-0.9.0/data/cpp/template/function/_iterator_dict.j2 +18 -0
- tranp-0.9.0/data/cpp/template/function/_iterator_list.j2 +11 -0
- tranp-0.9.0/data/cpp/template/function/_iterator_list_complex.j2 +17 -0
- tranp-0.9.0/data/cpp/template/function/_method_body.j2 +9 -0
- tranp-0.9.0/data/cpp/template/function/_params.j2 +8 -0
- tranp-0.9.0/data/cpp/template/function/_return_type.j2 +1 -0
- tranp-0.9.0/data/cpp/template/function/_signature_common.j2 +1 -0
- tranp-0.9.0/data/cpp/template/function/_signature_constructor.j2 +1 -0
- tranp-0.9.0/data/cpp/template/function/_signature_prefix.j2 +1 -0
- tranp-0.9.0/data/cpp/template/function/_signature_suffix.j2 +1 -0
- tranp-0.9.0/data/cpp/template/function/_template_types.j2 +4 -0
- tranp-0.9.0/data/cpp/template/function/class_method.j2 +10 -0
- tranp-0.9.0/data/cpp/template/function/closure.j2 +2 -0
- tranp-0.9.0/data/cpp/template/function/constructor.j2 +10 -0
- tranp-0.9.0/data/cpp/template/function/copy_constructor.j2 +10 -0
- tranp-0.9.0/data/cpp/template/function/destructor.j2 +14 -0
- tranp-0.9.0/data/cpp/template/function/function.j2 +9 -0
- tranp-0.9.0/data/cpp/template/function/method.j2 +10 -0
- tranp-0.9.0/data/cpp/template/indexer/class.j2 +1 -0
- tranp-0.9.0/data/cpp/template/indexer/cvar.j2 +1 -0
- tranp-0.9.0/data/cpp/template/indexer/default.j2 +1 -0
- tranp-0.9.0/data/cpp/template/indexer/slice_array.j2 +10 -0
- tranp-0.9.0/data/cpp/template/indexer/slice_string.j2 +7 -0
- tranp-0.9.0/data/cpp/template/indexer/tuple.j2 +1 -0
- tranp-0.9.0/data/cpp/template/lambda/_lambda_params.j2 +5 -0
- tranp-0.9.0/data/cpp/template/lambda/default.j2 +7 -0
- tranp-0.9.0/data/cpp/template/literal/dict.j2 +9 -0
- tranp-0.9.0/data/cpp/template/literal/doc_string.j2 +34 -0
- tranp-0.9.0/data/cpp/template/literal/falsy.j2 +1 -0
- tranp-0.9.0/data/cpp/template/literal/float.j2 +1 -0
- tranp-0.9.0/data/cpp/template/literal/integer.j2 +1 -0
- tranp-0.9.0/data/cpp/template/literal/list.j2 +9 -0
- tranp-0.9.0/data/cpp/template/literal/list_spread.j2 +11 -0
- tranp-0.9.0/data/cpp/template/literal/null.j2 +1 -0
- tranp-0.9.0/data/cpp/template/literal/pair.j2 +1 -0
- tranp-0.9.0/data/cpp/template/literal/string.j2 +1 -0
- tranp-0.9.0/data/cpp/template/literal/truthy.j2 +1 -0
- tranp-0.9.0/data/cpp/template/literal/tuple.j2 +1 -0
- tranp-0.9.0/data/cpp/template/operation/binary_fill_list.j2 +5 -0
- tranp-0.9.0/data/cpp/template/operation/binary_in.j2 +9 -0
- tranp-0.9.0/data/cpp/template/operation/binary_operator.j2 +13 -0
- tranp-0.9.0/data/cpp/template/operation/ternary_operator.j2 +1 -0
- tranp-0.9.0/data/cpp/template/operation/unary_operator.j2 +1 -0
- tranp-0.9.0/data/cpp/template/reference/class_ref.j2 +1 -0
- tranp-0.9.0/data/cpp/template/reference/decl_this_var.j2 +1 -0
- tranp-0.9.0/data/cpp/template/reference/this_ref.j2 +1 -0
- tranp-0.9.0/data/cpp/template/reference/var.j2 +5 -0
- tranp-0.9.0/data/cpp/template/relay/cvar_to.j2 +11 -0
- tranp-0.9.0/data/cpp/template/relay/default.j2 +7 -0
- tranp-0.9.0/data/cpp/template/relay/literalize.j2 +5 -0
- tranp-0.9.0/data/cpp/template/statement/_delete.j2 +7 -0
- tranp-0.9.0/data/cpp/template/statement/assert.j2 +1 -0
- tranp-0.9.0/data/cpp/template/statement/break.j2 +1 -0
- tranp-0.9.0/data/cpp/template/statement/comment.j2 +1 -0
- tranp-0.9.0/data/cpp/template/statement/continue.j2 +1 -0
- tranp-0.9.0/data/cpp/template/statement/delete.j2 +4 -0
- tranp-0.9.0/data/cpp/template/statement/import.j2 +5 -0
- tranp-0.9.0/data/cpp/template/statement/import_i18n.j2 +1 -0
- tranp-0.9.0/data/cpp/template/statement/pass.j2 +0 -0
- tranp-0.9.0/data/cpp/template/statement/return.j2 +5 -0
- tranp-0.9.0/data/cpp/template/statement/throw.j2 +8 -0
- tranp-0.9.0/data/cpp/template/statement/yield.j2 +1 -0
- tranp-0.9.0/data/cpp/template/type/callable_type.j2 +2 -0
- tranp-0.9.0/data/cpp/template/type/custom_type.j2 +28 -0
- tranp-0.9.0/data/cpp/template/type/dict_type.j2 +2 -0
- tranp-0.9.0/data/cpp/template/type/list_type.j2 +2 -0
- tranp-0.9.0/data/cpp/template/type/literal_dict_type.j2 +1 -0
- tranp-0.9.0/data/cpp/template/type/literal_type.j2 +1 -0
- tranp-0.9.0/data/cpp/template/type/null_type.j2 +1 -0
- tranp-0.9.0/data/cpp/template/type/pluck_method.j2 +2 -0
- tranp-0.9.0/data/cpp/template/type/relay_of_type.j2 +2 -0
- tranp-0.9.0/data/cpp/template/type/template.j2 +5 -0
- tranp-0.9.0/data/cpp/template/type/var_of_type.j2 +1 -0
- tranp-0.9.0/data/grammar.lark +370 -0
- tranp-0.9.0/data/i18n.yml +86 -0
- tranp-0.9.0/data/syntax/gram_rules.py +123 -0
- tranp-0.9.0/data/syntax/gram_tokenizer.py +15 -0
- tranp-0.9.0/data/syntax/py_rules.py +718 -0
- tranp-0.9.0/pyproject.toml +40 -0
- tranp-0.9.0/rogw/tranp/app/app.py +42 -0
- tranp-0.9.0/rogw/tranp/app/config.py +56 -0
- tranp-0.9.0/rogw/tranp/app/dir.py +12 -0
- tranp-0.9.0/rogw/tranp/app/dummy.py +44 -0
- tranp-0.9.0/rogw/tranp/app/env.py +52 -0
- tranp-0.9.0/rogw/tranp/app/loader.py +111 -0
- tranp-0.9.0/rogw/tranp/bin/analyze.py +480 -0
- tranp-0.9.0/rogw/tranp/bin/ast_check.py +233 -0
- tranp-0.9.0/rogw/tranp/bin/gram_check.py +176 -0
- tranp-0.9.0/rogw/tranp/bin/io.py +46 -0
- tranp-0.9.0/rogw/tranp/bin/j2_check.py +70 -0
- tranp-0.9.0/rogw/tranp/bin/transpile.py +478 -0
- tranp-0.9.0/rogw/tranp/cache/cache.py +268 -0
- tranp-0.9.0/rogw/tranp/cache/memo.py +84 -0
- tranp-0.9.0/rogw/tranp/cache/memo2.py +47 -0
- tranp-0.9.0/rogw/tranp/compatible/cpp/classes.py +25 -0
- tranp-0.9.0/rogw/tranp/compatible/cpp/convertion.py +47 -0
- tranp-0.9.0/rogw/tranp/compatible/cpp/cvar.py +625 -0
- tranp-0.9.0/rogw/tranp/compatible/cpp/function.py +58 -0
- tranp-0.9.0/rogw/tranp/compatible/cpp/preprocess.py +52 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/abc.py +4 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/binascii.py +1 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/classes.py +235 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/collections/abc.py +12 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/colorsys.py +2 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/datetime.py +21 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/enum.py +23 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/importlib.py +4 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/inspect.py +9 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/json.py +5 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/math.py +8 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/numpy.py +25 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/os.py +16 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/re.py +17 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/sys.py +3 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/type.py +1 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/types.py +5 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/typing.py +40 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/uuid.py +3 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/weakref.py +7 -0
- tranp-0.9.0/rogw/tranp/compatible/libralies/yaml.py +4 -0
- tranp-0.9.0/rogw/tranp/compatible/python/embed.py +238 -0
- tranp-0.9.0/rogw/tranp/compatible/python/types.py +10 -0
- tranp-0.9.0/rogw/tranp/data/meta/header.py +91 -0
- tranp-0.9.0/rogw/tranp/data/meta/types.py +39 -0
- tranp-0.9.0/rogw/tranp/data/version.py +13 -0
- tranp-0.9.0/rogw/tranp/dsn/dsn.py +124 -0
- tranp-0.9.0/rogw/tranp/dsn/module.py +164 -0
- tranp-0.9.0/rogw/tranp/dsn/translation.py +27 -0
- tranp-0.9.0/rogw/tranp/errors.py +31 -0
- tranp-0.9.0/rogw/tranp/file/loader.py +63 -0
- tranp-0.9.0/rogw/tranp/file/writer.py +46 -0
- tranp-0.9.0/rogw/tranp/i18n/i18n.py +57 -0
- tranp-0.9.0/rogw/tranp/implements/cpp/providers/i18n.py +18 -0
- tranp-0.9.0/rogw/tranp/implements/cpp/providers/view.py +19 -0
- tranp-0.9.0/rogw/tranp/implements/cpp/semantics/cvars.py +278 -0
- tranp-0.9.0/rogw/tranp/implements/cpp/transpiler/py2cpp.py +1830 -0
- tranp-0.9.0/rogw/tranp/implements/cpp/view/cpp_view_helper.py +216 -0
- tranp-0.9.0/rogw/tranp/implements/syntax/lark/entry.py +195 -0
- tranp-0.9.0/rogw/tranp/implements/syntax/lark/parser.py +179 -0
- tranp-0.9.0/rogw/tranp/implements/syntax/tranp/ast.py +234 -0
- tranp-0.9.0/rogw/tranp/implements/syntax/tranp/rule.py +742 -0
- tranp-0.9.0/rogw/tranp/implements/syntax/tranp/syntax.py +406 -0
- tranp-0.9.0/rogw/tranp/implements/syntax/tranp/token.py +382 -0
- tranp-0.9.0/rogw/tranp/implements/syntax/tranp/tokenizer.py +564 -0
- tranp-0.9.0/rogw/tranp/implements/transpiler/evaluator.py +261 -0
- tranp-0.9.0/rogw/tranp/lang/annotation.py +49 -0
- tranp-0.9.0/rogw/tranp/lang/comment.py +224 -0
- tranp-0.9.0/rogw/tranp/lang/convertion.py +30 -0
- tranp-0.9.0/rogw/tranp/lang/defer.py +93 -0
- tranp-0.9.0/rogw/tranp/lang/di.py +416 -0
- tranp-0.9.0/rogw/tranp/lang/dict.py +49 -0
- tranp-0.9.0/rogw/tranp/lang/error.py +77 -0
- tranp-0.9.0/rogw/tranp/lang/locator.py +56 -0
- tranp-0.9.0/rogw/tranp/lang/middleware.py +128 -0
- tranp-0.9.0/rogw/tranp/lang/module.py +92 -0
- tranp-0.9.0/rogw/tranp/lang/profile.py +37 -0
- tranp-0.9.0/rogw/tranp/lang/sequence.py +120 -0
- tranp-0.9.0/rogw/tranp/lang/string.py +49 -0
- tranp-0.9.0/rogw/tranp/lang/trace.py +60 -0
- tranp-0.9.0/rogw/tranp/lang/trait.py +132 -0
- tranp-0.9.0/rogw/tranp/lang/translator.py +16 -0
- tranp-0.9.0/rogw/tranp/lang/typehint.py +624 -0
- tranp-0.9.0/rogw/tranp/module/includer.py +33 -0
- tranp-0.9.0/rogw/tranp/module/loader.py +56 -0
- tranp-0.9.0/rogw/tranp/module/module.py +83 -0
- tranp-0.9.0/rogw/tranp/module/modules.py +121 -0
- tranp-0.9.0/rogw/tranp/module/types.py +26 -0
- tranp-0.9.0/rogw/tranp/providers/app.py +62 -0
- tranp-0.9.0/rogw/tranp/providers/cache.py +10 -0
- tranp-0.9.0/rogw/tranp/providers/module.py +113 -0
- tranp-0.9.0/rogw/tranp/providers/semantics.py +47 -0
- tranp-0.9.0/rogw/tranp/providers/syntax/ast.py +40 -0
- tranp-0.9.0/rogw/tranp/providers/syntax/entrypoints.py +50 -0
- tranp-0.9.0/rogw/tranp/providers/syntax/resolver.py +130 -0
- tranp-0.9.0/rogw/tranp/semantics/finder.py +285 -0
- tranp-0.9.0/rogw/tranp/semantics/procedure.py +263 -0
- tranp-0.9.0/rogw/tranp/semantics/processor.py +32 -0
- tranp-0.9.0/rogw/tranp/semantics/processors/expand_modules.py +197 -0
- tranp-0.9.0/rogw/tranp/semantics/processors/resolve_unknown.py +180 -0
- tranp-0.9.0/rogw/tranp/semantics/processors/restore_symbols.py +40 -0
- tranp-0.9.0/rogw/tranp/semantics/processors/store_symbols.py +32 -0
- tranp-0.9.0/rogw/tranp/semantics/processors/symbol_extends.py +161 -0
- tranp-0.9.0/rogw/tranp/semantics/reflection/base.py +228 -0
- tranp-0.9.0/rogw/tranp/semantics/reflection/db.py +214 -0
- tranp-0.9.0/rogw/tranp/semantics/reflection/definition.py +1 -0
- tranp-0.9.0/rogw/tranp/semantics/reflection/helper/naming.py +287 -0
- tranp-0.9.0/rogw/tranp/semantics/reflection/helper/template.py +472 -0
- tranp-0.9.0/rogw/tranp/semantics/reflection/interfaces.py +177 -0
- tranp-0.9.0/rogw/tranp/semantics/reflection/persistent.py +183 -0
- tranp-0.9.0/rogw/tranp/semantics/reflection/reflection.py +422 -0
- tranp-0.9.0/rogw/tranp/semantics/reflection/serialization.py +35 -0
- tranp-0.9.0/rogw/tranp/semantics/reflection/serializer.py +133 -0
- tranp-0.9.0/rogw/tranp/semantics/reflection/traits.py +475 -0
- tranp-0.9.0/rogw/tranp/semantics/reflections.py +709 -0
- tranp-0.9.0/rogw/tranp/syntax/ast/cache.py +97 -0
- tranp-0.9.0/rogw/tranp/syntax/ast/entry.py +150 -0
- tranp-0.9.0/rogw/tranp/syntax/ast/entrypoints.py +71 -0
- tranp-0.9.0/rogw/tranp/syntax/ast/finder.py +143 -0
- tranp-0.9.0/rogw/tranp/syntax/ast/parser.py +47 -0
- tranp-0.9.0/rogw/tranp/syntax/ast/path.py +186 -0
- tranp-0.9.0/rogw/tranp/syntax/ast/query.py +134 -0
- tranp-0.9.0/rogw/tranp/syntax/ast/resolver.py +114 -0
- tranp-0.9.0/rogw/tranp/syntax/node/accessible.py +43 -0
- tranp-0.9.0/rogw/tranp/syntax/node/behavior.py +34 -0
- tranp-0.9.0/rogw/tranp/syntax/node/definition/__init__.py +182 -0
- tranp-0.9.0/rogw/tranp/syntax/node/definition/accessible.py +83 -0
- tranp-0.9.0/rogw/tranp/syntax/node/definition/element.py +71 -0
- tranp-0.9.0/rogw/tranp/syntax/node/definition/expression.py +18 -0
- tranp-0.9.0/rogw/tranp/syntax/node/definition/general.py +51 -0
- tranp-0.9.0/rogw/tranp/syntax/node/definition/literal.py +173 -0
- tranp-0.9.0/rogw/tranp/syntax/node/definition/operator.py +94 -0
- tranp-0.9.0/rogw/tranp/syntax/node/definition/primary.py +883 -0
- tranp-0.9.0/rogw/tranp/syntax/node/definition/statement_compound.py +836 -0
- tranp-0.9.0/rogw/tranp/syntax/node/definition/statement_simple.py +184 -0
- tranp-0.9.0/rogw/tranp/syntax/node/definition/terminal.py +36 -0
- tranp-0.9.0/rogw/tranp/syntax/node/embed.py +229 -0
- tranp-0.9.0/rogw/tranp/syntax/node/interface.py +72 -0
- tranp-0.9.0/rogw/tranp/syntax/node/node.py +574 -0
- tranp-0.9.0/rogw/tranp/syntax/node/query.py +230 -0
- tranp-0.9.0/rogw/tranp/syntax/node/resolver.py +59 -0
- tranp-0.9.0/rogw/tranp/syntax/node/serializer.py +49 -0
- tranp-0.9.0/rogw/tranp/test/case_discovery.py +73 -0
- tranp-0.9.0/rogw/tranp/test/helper.py +35 -0
- tranp-0.9.0/rogw/tranp/test/validation.py +31 -0
- tranp-0.9.0/rogw/tranp/transpiler/middleware.py +73 -0
- tranp-0.9.0/rogw/tranp/transpiler/types.py +55 -0
- tranp-0.9.0/rogw/tranp/view/error_render.py +144 -0
- tranp-0.9.0/rogw/tranp/view/helper/block.py +371 -0
- tranp-0.9.0/rogw/tranp/view/helper/decorator.py +239 -0
- tranp-0.9.0/rogw/tranp/view/helper/helper.py +112 -0
- tranp-0.9.0/rogw/tranp/view/render.py +68 -0
- tranp-0.9.0/setup.cfg +4 -0
- tranp-0.9.0/tranp.egg-info/PKG-INFO +79 -0
- tranp-0.9.0/tranp.egg-info/SOURCES.txt +361 -0
- tranp-0.9.0/tranp.egg-info/dependency_links.txt +1 -0
- tranp-0.9.0/tranp.egg-info/top_level.txt +3 -0
tranp-0.9.0/LICENCE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 rog-works
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
tranp-0.9.0/PKG-INFO
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tranp
|
|
3
|
+
Version: 0.9.0
|
|
4
|
+
Summary: A language-agnostic source-to-source transpiler framework.
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Keywords: transpiler,transpilation,source-to-source,compiler,code generation
|
|
7
|
+
Classifier: Development Status :: 4 - Beta
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: C++
|
|
10
|
+
Classifier: Topic :: Software Development :: Compilers
|
|
11
|
+
Requires-Python: >=3.13
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENCE
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
tranp (TRANspiler on Python)
|
|
17
|
+
===
|
|
18
|
+
|
|
19
|
+
[](https://github.com/rog-works/tranp/actions/workflows/test.yml)
|
|
20
|
+
[](https://codecov.io/gh/rog-works/tranp)
|
|
21
|
+
[](LICENSE)
|
|
22
|
+
|
|
23
|
+
# 概要
|
|
24
|
+
|
|
25
|
+
* 言語非依存(※1)のトランスパイルフレームワーク
|
|
26
|
+
* 入力言語のAST(※2)を元に、出力言語のソースコードをレンダリング
|
|
27
|
+
* トランスパイルのリアルタイム変換や変換時のシンボル解析、グラマー・ASTの解析ツールを付属
|
|
28
|
+
* ※1: 現状はPythonからC++への変換のみ実装
|
|
29
|
+
* ※2: ASTの生成は外部ツールを利用(自由に変更可能)
|
|
30
|
+
|
|
31
|
+
# 必須要件
|
|
32
|
+
|
|
33
|
+
* Python 3.13
|
|
34
|
+
* Lark 1.3.1
|
|
35
|
+
* Jinja2 3.1.4
|
|
36
|
+
* PyYAML 6.0.2
|
|
37
|
+
|
|
38
|
+
# インストール
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
$ pip install tranp
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
# 使用方法
|
|
45
|
+
|
|
46
|
+
## トランスパイラー (Python to C++)
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
$ bash bin/transpile.sh
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## ソースコード解析ツール
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
$ bash bin/analyze.sh
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## グラマー解析ツール
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
$ bash bin/gram.sh
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## AST解析ツール
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
$ bash bin/ast.sh
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
# テスト
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
$ bash bin/test.sh
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
# ライセンス
|
|
77
|
+
|
|
78
|
+
[MIT](LICENCE)
|
|
79
|
+
* tranpを用いて生成したトランスパイル後のソースコードに関してはライセンスに含まれません
|
tranp-0.9.0/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
tranp (TRANspiler on Python)
|
|
2
|
+
===
|
|
3
|
+
|
|
4
|
+
[](https://github.com/rog-works/tranp/actions/workflows/test.yml)
|
|
5
|
+
[](https://codecov.io/gh/rog-works/tranp)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
# 概要
|
|
9
|
+
|
|
10
|
+
* 言語非依存(※1)のトランスパイルフレームワーク
|
|
11
|
+
* 入力言語のAST(※2)を元に、出力言語のソースコードをレンダリング
|
|
12
|
+
* トランスパイルのリアルタイム変換や変換時のシンボル解析、グラマー・ASTの解析ツールを付属
|
|
13
|
+
* ※1: 現状はPythonからC++への変換のみ実装
|
|
14
|
+
* ※2: ASTの生成は外部ツールを利用(自由に変更可能)
|
|
15
|
+
|
|
16
|
+
# 必須要件
|
|
17
|
+
|
|
18
|
+
* Python 3.13
|
|
19
|
+
* Lark 1.3.1
|
|
20
|
+
* Jinja2 3.1.4
|
|
21
|
+
* PyYAML 6.0.2
|
|
22
|
+
|
|
23
|
+
# インストール
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
$ pip install tranp
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
# 使用方法
|
|
30
|
+
|
|
31
|
+
## トランスパイラー (Python to C++)
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
$ bash bin/transpile.sh
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## ソースコード解析ツール
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
$ bash bin/analyze.sh
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## グラマー解析ツール
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
$ bash bin/gram.sh
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## AST解析ツール
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
$ bash bin/ast.sh
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
# テスト
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
$ bash bin/test.sh
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
# ライセンス
|
|
62
|
+
|
|
63
|
+
[MIT](LICENCE)
|
|
64
|
+
* tranpを用いて生成したトランスパイル後のソースコードに関してはライセンスに含まれません
|
tranp-0.9.0/bin/ast.sh
ADDED
tranp-0.9.0/bin/cache.sh
ADDED
tranp-0.9.0/bin/gram.sh
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
cwd=$(cd $(dirname $0); pwd)
|
|
4
|
+
appdir=${cwd}/..
|
|
5
|
+
|
|
6
|
+
source ${cwd}/.env.sh
|
|
7
|
+
|
|
8
|
+
if [ "$1" != "-l" ]; then
|
|
9
|
+
echo '### Usage'
|
|
10
|
+
echo bin/profile.sh -l
|
|
11
|
+
echo bin/profile.sh -l '${query}'
|
|
12
|
+
exit
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
target=$1
|
|
16
|
+
shift
|
|
17
|
+
peco_opt=
|
|
18
|
+
if [ "${1}" != "" -a "${1:0:1}" != "-" ]; then
|
|
19
|
+
peco_opt="--query ${1}"
|
|
20
|
+
shift
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
target=$(find ./ -name 'test_*.py' | | egrep -v 'fixtures|vendor' | peco ${peco_opt})
|
|
24
|
+
target=$(echo "$target" | sed -e 's/^.\///g')
|
|
25
|
+
target=$(echo "$target" | sed -e 's/\//\./g')
|
|
26
|
+
target=$(echo "$target" | sed -e 's/\.py$//g')
|
|
27
|
+
|
|
28
|
+
echo python -m unittest ${target}
|
|
29
|
+
cd ${appdir} && ./vendor/bin/pyinstrument -m unittest ${target}
|
tranp-0.9.0/bin/j2.sh
ADDED
tranp-0.9.0/bin/test.sh
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
cwd=$(cd $(dirname $0); pwd)
|
|
4
|
+
appdir=${cwd}/..
|
|
5
|
+
|
|
6
|
+
if [ "$1" == "-h" ]; then
|
|
7
|
+
cat << EOS
|
|
8
|
+
# Usage
|
|
9
|
+
$ bin/test.sh [-l module_name] [-c case_name] [-v] [-p]
|
|
10
|
+
# Examples
|
|
11
|
+
$ bin/test.sh -l py2cpp
|
|
12
|
+
$ bin/test.sh -l reflections -c type_of
|
|
13
|
+
$ bin/test.sh -l py2cpp -v
|
|
14
|
+
$ bin/test.sh -l py2cpp -p
|
|
15
|
+
EOS
|
|
16
|
+
exit
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
target=
|
|
20
|
+
if [ "$1" == "-l" ]; then
|
|
21
|
+
shift
|
|
22
|
+
peco_opt=
|
|
23
|
+
if [ "${1}" != "" -a "${1:0:1}" != "-" ]; then
|
|
24
|
+
peco_opt="--query ${1}"
|
|
25
|
+
shift
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
module=$(find ./ -name 'test_*.py' | egrep -v 'fixtures|vendor' | peco ${peco_opt})
|
|
29
|
+
target=$(echo "$module" | sed -e 's/^.\///g')
|
|
30
|
+
target=$(echo "$target" | sed -e 's/\//\./g')
|
|
31
|
+
target=$(echo "$target" | sed -e 's/\.py$//g')
|
|
32
|
+
|
|
33
|
+
if [ "$1" == "-c" ]; then
|
|
34
|
+
shift
|
|
35
|
+
peco_opt=
|
|
36
|
+
if [ "${1}" != "" -a "${1:0:1}" != "-" ]; then
|
|
37
|
+
peco_opt="--query ${1}"
|
|
38
|
+
shift
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
case=$(python ${appdir}/rogw/tranp/test/case_discovery.py ${module} | cat - | peco ${peco_opt})
|
|
42
|
+
target="${target}.${case}"
|
|
43
|
+
fi
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
while [ $# -gt 0 ]; do
|
|
47
|
+
if [ "${1}" == "-v" ]; then
|
|
48
|
+
export TRANPVERBOSE=1
|
|
49
|
+
elif [ "${1}" == "-p" ]; then
|
|
50
|
+
export TRANPPROFILE=1
|
|
51
|
+
elif [ "${1}" == "--index" ]; then
|
|
52
|
+
shift
|
|
53
|
+
export TRANPTESTINDEX=$1
|
|
54
|
+
fi
|
|
55
|
+
shift
|
|
56
|
+
done
|
|
57
|
+
|
|
58
|
+
source ${cwd}/.env.sh
|
|
59
|
+
|
|
60
|
+
if [ "$target" == "" ]; then
|
|
61
|
+
echo python -m unittest discover ${appdir}/tests/
|
|
62
|
+
python -m unittest discover ${appdir}/tests/
|
|
63
|
+
else
|
|
64
|
+
echo python -m unittest ${target} ${profiler}
|
|
65
|
+
python -m unittest ${target} ${profiler}
|
|
66
|
+
fi
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
{%- if is_initializer -%}
|
|
2
|
+
{% if 'Embed::static' in annotations %}static {% endif %}{{ var_type }} {{ receiver }}{% if value %}{{ '{' + value[(var_type | length) + 1:-1] + '}' }}{% endif %};
|
|
3
|
+
{%- else -%}
|
|
4
|
+
{% if 'Embed::static' in annotations %}static {% endif %}{{ var_type }} {{ receiver }}{% if value %} = {{ value }}{% endif %};
|
|
5
|
+
{%- endif -%}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{ receiver }} {{ operator }} {{ value }};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{ receiver }} = {{ value }};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{%- if is_initializer -%}
|
|
2
|
+
{{ var_type }} {{ receiver }}{{ '{' + value[(var_type | length) + 1:-1] + '}' }};
|
|
3
|
+
{%- elif is_static -%}
|
|
4
|
+
static {{ var_type }} {{ receiver }} = {{ (break_last_block(value, '{}')[1].strip() | replace('return ', ''))[:-1] }};
|
|
5
|
+
{%- else -%}
|
|
6
|
+
{{ var_type }} {{ receiver }} = {{ value }};
|
|
7
|
+
{%- endif -%}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
auto [{{ receivers | join(', ') }}] = {{ value }};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{% include('assign/move_assign.j2') %}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{%- if accessor %}{{ accessor }}:{{ '\n' }}{% endif -%}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{%- if comment %}{{ comment }}{% else %}/** {{ symbol }} */{% endif %}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{%- for inherit in inherits -%}
|
|
2
|
+
{%- if not deco_ignore.any_args(inherit) -%}
|
|
3
|
+
{%- set _inherit_qual = inherit.split('<')[0] %}
|
|
4
|
+
{%- set _inherit_name = _inherit_qual.split('::')[-1] %}
|
|
5
|
+
using {{ _inherit_qual }}::{{ _inherit_name }};
|
|
6
|
+
{%- endif -%}
|
|
7
|
+
{%- endfor -%}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{- accessor }}: inline static {{ decl_class_var -}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{- accessor }}: {{ decl_this_var -}}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{% include('class/_classify.j2') %} {{ symbol }}{% include('class/_inherits.j2') %}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{% if accessor %}{{ accessor }}: {% endif %}enum class {{ symbol }}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{%- set _inherits = namespace(at=[]) -%}
|
|
2
|
+
{%- if not deco_ignore -%}
|
|
3
|
+
{%- set _inherits.at = inherits -%}
|
|
4
|
+
{%- else -%}
|
|
5
|
+
{%- for inherit in inherits -%}
|
|
6
|
+
{%- if not deco_ignore.any_args(inherit) -%}
|
|
7
|
+
{%- set _inherits.at = _inherits.at + [inherit] -%}
|
|
8
|
+
{%- endif -%}
|
|
9
|
+
{%- endfor -%}
|
|
10
|
+
{%- endif -%}
|
|
11
|
+
{%- if (_inherits.at | length) > 0 %} : public {{ _inherits.at | join(', public ') }}{% endif -%}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{%- include('class/_decorators.j2') %}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{%- set is_number = '"' not in statements[0] -%}
|
|
2
|
+
{%- filter indent('\t') %}
|
|
3
|
+
{%- for statement in statements %}
|
|
4
|
+
{%- if statement.startswith('//') %}
|
|
5
|
+
{{ statement }}
|
|
6
|
+
{%- elif is_number %}
|
|
7
|
+
{{ statement.split(' ')[1:] | join(' ') | replace(';', ',') }}
|
|
8
|
+
{%- else %}
|
|
9
|
+
{{ statement.split(' ')[1] }},
|
|
10
|
+
{%- endif %}
|
|
11
|
+
{%- endfor %}
|
|
12
|
+
{%- endfilter %}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{% if accessor %}{{ accessor }}: {% endif %}using {{ symbol }} = {{ actual_type }};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{%- set deco_query = parse_decorators(decorators) -%}
|
|
2
|
+
{%- set deco_ignore = deco_query.any('Embed.ignore') -%}
|
|
3
|
+
{%- if deco_query.contains('Embed.python') -%}
|
|
4
|
+
// class {{ symbol }}
|
|
5
|
+
{%- else -%}
|
|
6
|
+
{%- include('class/_accessor.j2') %}
|
|
7
|
+
{%- include('class/_comment.j2') %}
|
|
8
|
+
{%- include('class/_prepare.j2') %}
|
|
9
|
+
{%- include('class/_template_types.j2') %}
|
|
10
|
+
{% include('class/_definition_class.j2') %} {
|
|
11
|
+
{%- include('class/_constructor_inherits.j2') %}
|
|
12
|
+
{%- include('class/_before.j2') %}
|
|
13
|
+
{%- include('class/_statements.j2') %}
|
|
14
|
+
{%- include('class/_after.j2') %}
|
|
15
|
+
};
|
|
16
|
+
{%- include('class/_post_definition.j2') %}
|
|
17
|
+
{%- endif -%}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{%- set deco_query = parse_decorators(decorators) -%}
|
|
2
|
+
{%- if deco_query.contains('Embed.python') -%}
|
|
3
|
+
// enum {{ symbol }}
|
|
4
|
+
{%- else -%}
|
|
5
|
+
{%- include('class/_comment.j2') %}
|
|
6
|
+
{%- include('class/_decorators.j2') %}
|
|
7
|
+
{% include('class/_definition_enum.j2') %} {
|
|
8
|
+
{%- include('class/_statements_enum.j2') %}
|
|
9
|
+
};
|
|
10
|
+
{%- endif -%}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{ receiver }}[{{ key }}] = {{ value }}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
{%- set values = break_last_block(iterates, '()')[1] -%}
|
|
2
|
+
auto [{{ symbols[0] }}, __iter, __end, {{ symbols[1] }}] = {{ i18n('classes', 'tuple') }}{0, {{ values }}.{{ i18n('cpp', 'vector.begin') }}(), {{ values }}.{{ i18n('cpp', 'vector.end') }}(), *({{ values }}.{{ i18n('cpp', 'vector.begin') }}())}; __iter < __end; __iter++, {{ symbols[1] }} = *__iter
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[&]() -> {{ i18n('classes', 'dict') }}<{{ projection_types[0] }}, {{ projection_types[1] }}> {
|
|
2
|
+
{{ i18n('classes', 'dict') }}<{{ projection_types[0] }}, {{ projection_types[1] }}> __ret;
|
|
3
|
+
for ({{ comp_for }}) {
|
|
4
|
+
{%- set receiver = '__ret' %}
|
|
5
|
+
{%- set key = projection_key %}
|
|
6
|
+
{%- set value = projection_value %}
|
|
7
|
+
{%- if condition %}
|
|
8
|
+
if ({{ condition }}) {
|
|
9
|
+
{% include('comp/_assign_dict.j2') %};
|
|
10
|
+
}
|
|
11
|
+
{%- else %}
|
|
12
|
+
{% include('comp/_assign_dict.j2') %};
|
|
13
|
+
{%- endif %}
|
|
14
|
+
}
|
|
15
|
+
return __ret;
|
|
16
|
+
}()
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
[&]() -> {{ i18n('classes', 'list') }}<{{ projection_types[0] }}> {
|
|
2
|
+
{{ i18n('classes', 'list') }}<{{ projection_types[0] }}> __ret;
|
|
3
|
+
for ({{ comp_for }}) {
|
|
4
|
+
{%- if condition %}
|
|
5
|
+
if ({{ condition }}) {
|
|
6
|
+
__ret.{{ i18n('classes', 'list.append') }}({{ projection }});
|
|
7
|
+
}
|
|
8
|
+
{%- else %}
|
|
9
|
+
__ret.{{ i18n('classes', 'list.append') }}({{ projection }});
|
|
10
|
+
{%- endif %}
|
|
11
|
+
}
|
|
12
|
+
return __ret;
|
|
13
|
+
}()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{- path }}({{ arguments | join(', ') }})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{ param_type_annotated(var_type, annotations, env_get('immutable_param_types', [])) }}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{ param_type_annotated(var_type, annotations, env_get('immutable_param_types', [])) }} {{ symbol }}{% if default_value %} = {{ default_value }}{% endif -%}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
({{ expression }})
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{%- set infer = ('const ' if is_const else '') + 'auto' + ('' if is_addr_raw else '&') -%}
|
|
2
|
+
for ({{ infer }} {% if symbols | length > 1 %}[{{ symbols | join(', ') }}]{% else %}{{ symbols[0] }}{% endif %} : {{ iterates }}) {
|
|
3
|
+
{%- filter indent('\t') %}
|
|
4
|
+
{%- for statement in statements %}
|
|
5
|
+
{{ statement }}
|
|
6
|
+
{%- endfor %}
|
|
7
|
+
{%- endfilter %}
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{%- set infer = ('const ' if is_const else '') + 'auto' + ('' if is_addr_raw else '&') -%}
|
|
2
|
+
for ({{ infer }} [{{ symbols | join(', ') }}] : {{ iterates }}) {
|
|
3
|
+
{%- filter indent('\t') %}
|
|
4
|
+
{%- for statement in statements %}
|
|
5
|
+
{{ statement }}
|
|
6
|
+
{%- endfor %}
|
|
7
|
+
{%- endfilter %}
|
|
8
|
+
}
|