string-to-code 0.2.10__py3-none-any.whl → 0.2.11__py3-none-any.whl

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.
string_to_code/to_ada.py CHANGED
@@ -34,7 +34,7 @@ _body_to_str = utils.get_body_to_str(
34
34
  )
35
35
 
36
36
 
37
- def _merge_to_full_function(in_function_name, in_function_body):
37
+ def _merge_to_full_function(in_function_name: str, in_function_body: str) -> str:
38
38
  return "\n".join(
39
39
  [
40
40
  f" procedure {in_function_name} is",
@@ -50,7 +50,7 @@ _function_to_code = utils.get_function_to_code(
50
50
  )
51
51
 
52
52
 
53
- def default_program_name():
53
+ def default_program_name() -> str:
54
54
  """returns the default program name used by the proc function"""
55
55
  return "Main"
56
56
 
@@ -58,13 +58,13 @@ def default_program_name():
58
58
  _MAIN_NULL_CALL = " " + _NULL_CALL + "\n"
59
59
 
60
60
 
61
- def _main_call_to_code(in_initial_call, **kwargs):
61
+ def _main_call_to_code(in_initial_call: core.InitialCall, **kwargs) -> str:
62
62
  if in_initial_call:
63
63
  return " " + _call_function_or_atom(in_initial_call, **kwargs) + "\n"
64
64
  return _MAIN_NULL_CALL
65
65
 
66
66
 
67
- def _join_to_final(main_call, function_definitions, **kwargs):
67
+ def _join_to_final(main_call: str, function_definitions: list[str], **kwargs) -> str:
68
68
  function_definitions_str = "\n".join(function_definitions)
69
69
  if function_definitions_str:
70
70
  function_definitions_str += "\n"
@@ -29,7 +29,7 @@ _call_function_or_atom = utils.get_call_function_or_atom(
29
29
  _body_to_str = utils.get_body_to_str("\n", " ", _call_function_or_atom, "", "")
30
30
 
31
31
 
32
- def _merge_to_full_function(in_function_name, in_function_body):
32
+ def _merge_to_full_function(in_function_name: str, in_function_body: str) -> str:
33
33
  body_str = ""
34
34
  if in_function_body:
35
35
  assert in_function_body[-1] == ";"
@@ -42,7 +42,7 @@ _function_to_code = utils.get_function_to_code(
42
42
  )
43
43
 
44
44
 
45
- def _main_call_to_code(in_initial_call, **kwargs):
45
+ def _main_call_to_code(in_initial_call: core.InitialCall, **kwargs) -> str:
46
46
  if in_initial_call is None:
47
47
  return 'print("")'
48
48
  res = _call_function_or_atom(in_initial_call, **kwargs)
@@ -50,7 +50,7 @@ def _main_call_to_code(in_initial_call, **kwargs):
50
50
  return res[:-1]
51
51
 
52
52
 
53
- def _join_to_final(main_call, function_definitions, **_kwargs):
53
+ def _join_to_final(main_call: str, function_definitions: list[str], **_kwargs) -> str:
54
54
  assert main_call[-1] != "\n"
55
55
  return "\n\n".join(function_definitions + [main_call + "\n"])
56
56
 
string_to_code/utils.py CHANGED
@@ -2,6 +2,7 @@
2
2
  utilities for to_some_language modules
3
3
  """
4
4
 
5
+ import typing
5
6
  from . import core
6
7
 
7
8
 
@@ -26,13 +27,16 @@ def get_function_call_str_fun(in_get_function_name, in_prefix: str, in_postfix:
26
27
  return _function_call_str
27
28
 
28
29
 
29
- def get_call_function_or_atom(in_atom_to_code, in_function_call_str):
30
+ def get_call_function_or_atom(
31
+ in_atom_to_code: typing.Callable[[core.Atom], str], in_function_call_str
32
+ ):
30
33
  """
31
34
  returns the function call_function_or_atom returning a string
32
35
  representing a function call or displayng given atom
33
36
  """
34
37
 
35
38
  def _inner(in_data: core.CalledListEntry, **kwargs) -> str:
39
+ assert in_data is not None
36
40
  if isinstance(in_data, core.Atom):
37
41
  return in_atom_to_code(in_data)
38
42
  assert isinstance(in_data, int)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: string-to-code
3
- Version: 0.2.10
3
+ Version: 0.2.11
4
4
  Summary: Generates a piece of messy code in a given language displaying a given string
5
5
  Home-page: https://github.com/vil02/string_to_code_proj
6
6
  License: MIT
@@ -3,8 +3,8 @@ string_to_code/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  string_to_code/c_like_utils.py,sha256=YiRkzo1e4oKAnWjUkgEy6rxkOYb1VlFVFz52otFR4AQ,2092
4
4
  string_to_code/core.py,sha256=VCiXEf7ojoc_1lxTiYlU3rav7Xcl-CGtUPuxSjYncuA,4351
5
5
  string_to_code/string_to_code.py,sha256=q0IyBfeDeDI2SCwlBOM_hwHdBfF1YQ7gn642o6cHU94,1290
6
- string_to_code/to_ada.py,sha256=cGZ8VFdAZkGYKGzEOEsAndGzfUt4bSCmZfQP04sAOF8,2265
7
- string_to_code/to_algol68.py,sha256=Y1jvfI5xbk-PHVWYW7KG7gSIUU5GPt7gjeaMuM6JIIQ,1642
6
+ string_to_code/to_ada.py,sha256=gihr2fg0_cbH-oT2BamkF9GA1u4ktKWGiGFAzxTsDyY,2337
7
+ string_to_code/to_algol68.py,sha256=RPBQcA3UaEHtj0fxsscYpJy7ZpY-3ZSvChmaLzXb8n8,1707
8
8
  string_to_code/to_ballerina.py,sha256=Z8F8r9hLZ5mvHzsjT5XDx_2cDlojBzva7UZcrMIQca0,1876
9
9
  string_to_code/to_bash.py,sha256=FJI2WTYO0gDDFSyRwHwERuLFKqOBX79y4xsXa_K_5D4,1634
10
10
  string_to_code/to_c.py,sha256=CeCzih5WoNABUg4dgps82wG783H8nW3FHj-69HZ5iOU,1008
@@ -17,8 +17,8 @@ string_to_code/to_nim.py,sha256=W74i6MRjQ5eYeatGyMwE-wYNEzN06l5oOXBv3lfbXgM,1534
17
17
  string_to_code/to_pascal.py,sha256=ZwOJgi3saoNP2_H7ZWpQykPg8c-jP-L8eOw_Zz2q8uc,1922
18
18
  string_to_code/to_python3.py,sha256=BJwjyhRB2IBOE3-xwkkMV3vZU-e2xreppYBKQeA1whg,1589
19
19
  string_to_code/to_rust.py,sha256=hTCjlortLhR7FwsBgbrFRcwXpKWA6ed2UYnz1OK8R7I,1926
20
- string_to_code/utils.py,sha256=m1QExBHCD3q-Tjkfl3HiFgjZUbPISZYIYOcr-FB0HGU,3504
21
- string_to_code-0.2.10.dist-info/LICENSE,sha256=LQrcSkcUyN1FtFYDxWK05puxNN9o2q8PV-_2SwFDTWc,1068
22
- string_to_code-0.2.10.dist-info/METADATA,sha256=482iLKXvXjtYG41tnW2A6qgbOjGW6FyJ-g6P5pR1Rbw,1850
23
- string_to_code-0.2.10.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
24
- string_to_code-0.2.10.dist-info/RECORD,,
20
+ string_to_code/utils.py,sha256=nfcAg-sRsSr1k-n1hU5l6LLIhQoNl6feAYLcNwpYgqY,3594
21
+ string_to_code-0.2.11.dist-info/LICENSE,sha256=LQrcSkcUyN1FtFYDxWK05puxNN9o2q8PV-_2SwFDTWc,1068
22
+ string_to_code-0.2.11.dist-info/METADATA,sha256=C1-Lo4INyqYJDia9tAh4lzieXd90vSws6ESFV21F1vs,1850
23
+ string_to_code-0.2.11.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
24
+ string_to_code-0.2.11.dist-info/RECORD,,