coco-tools 0.16__tar.gz → 0.18__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.
- {coco-tools-0.16/coco_tools.egg-info → coco-tools-0.18}/PKG-INFO +3 -2
- {coco-tools-0.16 → coco-tools-0.18}/README.md +2 -1
- {coco-tools-0.16 → coco-tools-0.18}/coco/__init__.py +1 -1
- {coco-tools-0.16 → coco-tools-0.18}/coco/b09/elements.py +12 -3
- {coco-tools-0.16 → coco-tools-0.18}/coco/b09/grammar.py +2 -2
- {coco-tools-0.16 → coco-tools-0.18}/coco/b09/parser.py +1 -1
- {coco-tools-0.16 → coco-tools-0.18}/coco/b09/visitors.py +15 -1
- {coco-tools-0.16 → coco-tools-0.18/coco_tools.egg-info}/PKG-INFO +3 -2
- {coco-tools-0.16 → coco-tools-0.18}/setup.py +1 -1
- {coco-tools-0.16 → coco-tools-0.18}/LICENSE +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco/b09/__init__.py +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco/b09/compiler.py +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco/b09/error_handler.py +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco/b09/procbank.py +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco/b09/prog.py +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco/cm3toppm.py +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco/decb_to_b09.py +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco/hrstoppm.py +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco/maxtoppm.py +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco/mge_viewer2.py +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco/mgetoppm.py +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco/pixtopgm.py +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco/rattoppm.py +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco/resources/__init__.py +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco/resources/ecb.b09 +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco/util.py +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco/veftopng.py +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco_tools.egg-info/SOURCES.txt +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco_tools.egg-info/dependency_links.txt +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco_tools.egg-info/entry_points.txt +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco_tools.egg-info/requires.txt +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/coco_tools.egg-info/top_level.txt +0 -0
- {coco-tools-0.16 → coco-tools-0.18}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: coco-tools
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.18
|
|
4
4
|
Summary: TRS-80 Color Computer Tools
|
|
5
5
|
Home-page: https://github.com/jamieleecho/coco-tools
|
|
6
6
|
Author: Jamie Cho
|
|
@@ -257,12 +257,13 @@ pre-commit install
|
|
|
257
257
|
```
|
|
258
258
|
|
|
259
259
|
## Credits
|
|
260
|
-
The programs in the examples/decb
|
|
260
|
+
The programs in the examples/decb and examples/other-decb-examples-to-try directories are from the following sources:
|
|
261
261
|
* alien4k0.bas -- https://github.com/jggames/trs80mc10/blob/9df4c9578250009d68a03101d626faa3c22e7445/quicktype/Arcade/4K/Alien4K/ALIEN4K0.TXT#L4
|
|
262
262
|
* bach.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/bach.c10
|
|
263
263
|
* banner.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/banner.c10
|
|
264
264
|
* cadnza.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/cadnza.c10
|
|
265
265
|
* cflip.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/cflip.c10
|
|
266
266
|
* loops.bas -- https://colorcomputerarchive.com/repo/Documents/Manuals/Hardware/Color%20Computer%203%20Extended%20Basic%20(Tandy).pdf
|
|
267
|
+
* f15eagle.bas -- https://colorcomputerarchive.com/repo/Disks/Magazines/Rainbow%20On%20Disk.zip
|
|
267
268
|
* mars.bas -- https://github.com/jggames/trs80mc10/tree/9df4c9578250009d68a03101d626faa3c22e7445/quicktype/Text%20Adventures/WorkInProgress/Mars
|
|
268
269
|
* saints.bas -- https://colorcomputerarchive.com/repo/Documents/Manuals/Hardware/Color%20Computer%203%20Extended%20Basic%20(Tandy).pdf
|
|
@@ -239,12 +239,13 @@ pre-commit install
|
|
|
239
239
|
```
|
|
240
240
|
|
|
241
241
|
## Credits
|
|
242
|
-
The programs in the examples/decb
|
|
242
|
+
The programs in the examples/decb and examples/other-decb-examples-to-try directories are from the following sources:
|
|
243
243
|
* alien4k0.bas -- https://github.com/jggames/trs80mc10/blob/9df4c9578250009d68a03101d626faa3c22e7445/quicktype/Arcade/4K/Alien4K/ALIEN4K0.TXT#L4
|
|
244
244
|
* bach.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/bach.c10
|
|
245
245
|
* banner.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/banner.c10
|
|
246
246
|
* cadnza.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/cadnza.c10
|
|
247
247
|
* cflip.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/cflip.c10
|
|
248
248
|
* loops.bas -- https://colorcomputerarchive.com/repo/Documents/Manuals/Hardware/Color%20Computer%203%20Extended%20Basic%20(Tandy).pdf
|
|
249
|
+
* f15eagle.bas -- https://colorcomputerarchive.com/repo/Disks/Magazines/Rainbow%20On%20Disk.zip
|
|
249
250
|
* mars.bas -- https://github.com/jggames/trs80mc10/tree/9df4c9578250009d68a03101d626faa3c22e7445/quicktype/Text%20Adventures/WorkInProgress/Mars
|
|
250
251
|
* saints.bas -- https://colorcomputerarchive.com/repo/Documents/Manuals/Hardware/Color%20Computer%203%20Extended%20Basic%20(Tandy).pdf
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# __version__ MUST be defined on line 2
|
|
2
|
-
__version__ = "0.
|
|
2
|
+
__version__ = "0.18"
|
|
@@ -449,7 +449,9 @@ class BasicIfElse(BasicIf):
|
|
|
449
449
|
else_suffix = (
|
|
450
450
|
""
|
|
451
451
|
if self._else_statements is None
|
|
452
|
-
else f"{self.
|
|
452
|
+
else f"{self.indent_spaces(indent_level + 1)}EXITIF TRUE THEN\n"
|
|
453
|
+
f"{self._else_statements.basic09_text(indent_level + 2)}\n"
|
|
454
|
+
f"{self.indent_spaces(indent_level + 1)}ENDEXIT\n"
|
|
453
455
|
)
|
|
454
456
|
return (
|
|
455
457
|
f"{self.indent_spaces(indent_level)}LOOP\n"
|
|
@@ -1001,7 +1003,15 @@ class BasicDimStatement(AbstractBasicStatement):
|
|
|
1001
1003
|
def default_str_storage(self, val):
|
|
1002
1004
|
self._default_str_storage = val
|
|
1003
1005
|
|
|
1004
|
-
def init_text_for_var(self, dim_var):
|
|
1006
|
+
def init_text_for_var(self, dim_var: "BasicArrayRef | BasicVar") -> str:
|
|
1007
|
+
if isinstance(dim_var, BasicVar):
|
|
1008
|
+
return BasicStatements(
|
|
1009
|
+
[
|
|
1010
|
+
BasicAssignment(dim_var, BasicLiteral("" if dim_var.is_str_expr else 0)),
|
|
1011
|
+
],
|
|
1012
|
+
multi_line=False,
|
|
1013
|
+
).basic09_text(0)
|
|
1014
|
+
|
|
1005
1015
|
for_statements = (
|
|
1006
1016
|
BasicForStatement(
|
|
1007
1017
|
BasicVar(f"tmp_{ii + 1}"),
|
|
@@ -1083,7 +1093,6 @@ class BasicDimStatement(AbstractBasicStatement):
|
|
|
1083
1093
|
(
|
|
1084
1094
|
self.init_text_for_var(dim_var)
|
|
1085
1095
|
for dim_var in dim_vars
|
|
1086
|
-
if isinstance(dim_var, BasicArrayRef)
|
|
1087
1096
|
)
|
|
1088
1097
|
)
|
|
1089
1098
|
init_text = "\n" + init_text if init_text else ""
|
|
@@ -214,7 +214,7 @@ KEYWORDS = "|".join(
|
|
|
214
214
|
|
|
215
215
|
grammar = Grammar(
|
|
216
216
|
rf"""
|
|
217
|
-
aaa_prog = multi_line eol* ~r"\x00?" eof
|
|
217
|
+
aaa_prog = (space* eol+)* multi_line eol* ~r"\x00?" eof
|
|
218
218
|
multi_line = line space* multi_line_elements
|
|
219
219
|
multi_line_elements = multi_line_element*
|
|
220
220
|
multi_line_element = eol+ line space*
|
|
@@ -380,7 +380,7 @@ grammar = Grammar(
|
|
|
380
380
|
comment_text = ~r".*"
|
|
381
381
|
comment_token = ~r"(REM|')"
|
|
382
382
|
eof = ~r"$"
|
|
383
|
-
eol = ~r"[\n\r]
|
|
383
|
+
eol = ~r"[\n\r]"
|
|
384
384
|
linenum = ~r"[0-9]+"
|
|
385
385
|
literal = num_literal
|
|
386
386
|
hex_literal = ~r"& *H *[0-9A-F][0-9A-F]?[0-9A-F]?[0-9A-F]?[0-9A-F]?[0-9A-F]?"
|
|
@@ -134,7 +134,7 @@ class BasicVisitor(NodeVisitor):
|
|
|
134
134
|
return node
|
|
135
135
|
|
|
136
136
|
def visit_aaa_prog(self, _, visited_children):
|
|
137
|
-
return BasicProg(visited_children[
|
|
137
|
+
return BasicProg(visited_children[1])
|
|
138
138
|
|
|
139
139
|
def visit_arr_assign(self, _, visited_children):
|
|
140
140
|
let_kw, _, array_ref_exp, _, _, _, val_exp = visited_children
|
|
@@ -220,11 +220,16 @@ class StatementCollectorVisitor(BasicConstructVisitor):
|
|
|
220
220
|
|
|
221
221
|
|
|
222
222
|
class VarInitializerVisitor(BasicConstructVisitor):
|
|
223
|
+
_vars: Set[str]
|
|
224
|
+
_dimmed_var_names: Set[str]
|
|
225
|
+
|
|
223
226
|
def __init__(self):
|
|
224
227
|
self._vars = set()
|
|
228
|
+
self._dimmed_var_names = set()
|
|
225
229
|
|
|
226
230
|
@property
|
|
227
231
|
def assignment_lines(self) -> List[BasicLine]:
|
|
232
|
+
vars_to_assign = self._vars - self._dimmed_var_names
|
|
228
233
|
return [
|
|
229
234
|
BasicLine(
|
|
230
235
|
None,
|
|
@@ -237,7 +242,7 @@ class VarInitializerVisitor(BasicConstructVisitor):
|
|
|
237
242
|
is_str_expr=var.endswith("$"),
|
|
238
243
|
),
|
|
239
244
|
)
|
|
240
|
-
for var in sorted(
|
|
245
|
+
for var in sorted(vars_to_assign)
|
|
241
246
|
if ((var.endswith("$") and len(var) <= 3) or len(var) <= 2)
|
|
242
247
|
]
|
|
243
248
|
),
|
|
@@ -247,6 +252,15 @@ class VarInitializerVisitor(BasicConstructVisitor):
|
|
|
247
252
|
def visit_var(self, var) -> None:
|
|
248
253
|
self._vars.add(var.name())
|
|
249
254
|
|
|
255
|
+
def visit_statement(self, statement: BasicForStatement) -> None:
|
|
256
|
+
if isinstance(statement, BasicDimStatement):
|
|
257
|
+
self._dimmed_var_names.update(
|
|
258
|
+
[
|
|
259
|
+
var.var.name() if isinstance(var, BasicArrayRef) else var.name()
|
|
260
|
+
for var in statement.dim_vars
|
|
261
|
+
]
|
|
262
|
+
)
|
|
263
|
+
|
|
250
264
|
|
|
251
265
|
class StrVarAllocatorVisitor(BasicConstructVisitor):
|
|
252
266
|
_vars: Set[str]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: coco-tools
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.18
|
|
4
4
|
Summary: TRS-80 Color Computer Tools
|
|
5
5
|
Home-page: https://github.com/jamieleecho/coco-tools
|
|
6
6
|
Author: Jamie Cho
|
|
@@ -257,12 +257,13 @@ pre-commit install
|
|
|
257
257
|
```
|
|
258
258
|
|
|
259
259
|
## Credits
|
|
260
|
-
The programs in the examples/decb
|
|
260
|
+
The programs in the examples/decb and examples/other-decb-examples-to-try directories are from the following sources:
|
|
261
261
|
* alien4k0.bas -- https://github.com/jggames/trs80mc10/blob/9df4c9578250009d68a03101d626faa3c22e7445/quicktype/Arcade/4K/Alien4K/ALIEN4K0.TXT#L4
|
|
262
262
|
* bach.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/bach.c10
|
|
263
263
|
* banner.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/banner.c10
|
|
264
264
|
* cadnza.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/cadnza.c10
|
|
265
265
|
* cflip.bas -- https://colorcomputerarchive.com/repo/MC-10/Software/Books/TRS-80%20Color%20Computer%20%26%20MC-10%20Programs/cflip.c10
|
|
266
266
|
* loops.bas -- https://colorcomputerarchive.com/repo/Documents/Manuals/Hardware/Color%20Computer%203%20Extended%20Basic%20(Tandy).pdf
|
|
267
|
+
* f15eagle.bas -- https://colorcomputerarchive.com/repo/Disks/Magazines/Rainbow%20On%20Disk.zip
|
|
267
268
|
* mars.bas -- https://github.com/jggames/trs80mc10/tree/9df4c9578250009d68a03101d626faa3c22e7445/quicktype/Text%20Adventures/WorkInProgress/Mars
|
|
268
269
|
* saints.bas -- https://colorcomputerarchive.com/repo/Documents/Manuals/Hardware/Color%20Computer%203%20Extended%20Basic%20(Tandy).pdf
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|