oaknut-basic 13.4.0__tar.gz → 13.6.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.
Files changed (43) hide show
  1. {oaknut_basic-13.4.0/src/oaknut_basic.egg-info → oaknut_basic-13.6.0}/PKG-INFO +25 -7
  2. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/README.md +23 -4
  3. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/pyproject.toml +1 -4
  4. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut/basic/__init__.py +1 -1
  5. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut/basic/cli.py +3 -1
  6. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0/src/oaknut_basic.egg-info}/PKG-INFO +25 -7
  7. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/LICENSE +0 -0
  8. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/setup.cfg +0 -0
  9. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut/basic/datafile.py +0 -0
  10. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut/basic/detect.py +0 -0
  11. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut/basic/detokeniser.py +0 -0
  12. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut/basic/dialect.py +0 -0
  13. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut/basic/exceptions.py +0 -0
  14. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut/basic/float5.py +0 -0
  15. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut/basic/linenumber.py +0 -0
  16. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut/basic/numbering.py +0 -0
  17. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut/basic/scanner.py +0 -0
  18. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut/basic/tokeniser.py +0 -0
  19. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut/basic/tokens.py +0 -0
  20. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut_basic.egg-info/SOURCES.txt +0 -0
  21. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut_basic.egg-info/dependency_links.txt +0 -0
  22. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut_basic.egg-info/entry_points.txt +0 -0
  23. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut_basic.egg-info/requires.txt +0 -0
  24. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/src/oaknut_basic.egg-info/top_level.txt +0 -0
  25. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_basic.py +0 -0
  26. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_basic_v.py +0 -0
  27. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_cli.py +0 -0
  28. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_crunch_rules.py +0 -0
  29. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_data_cli.py +0 -0
  30. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_datafile.py +0 -0
  31. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_detect.py +0 -0
  32. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_detokeniser.py +0 -0
  33. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_float5.py +0 -0
  34. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_greedy_crunch.py +0 -0
  35. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_keyword_coverage.py +0 -0
  36. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_linenumber.py +0 -0
  37. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_numbering.py +0 -0
  38. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_packaging.py +0 -0
  39. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_rom_golden.py +0 -0
  40. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_rom_golden_detokenise.py +0 -0
  41. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_scanner.py +0 -0
  42. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_tokeniser.py +0 -0
  43. {oaknut_basic-13.4.0 → oaknut_basic-13.6.0}/tests/test_tokens.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oaknut-basic
3
- Version: 13.4.0
3
+ Version: 13.6.0
4
4
  Summary: BBC BASIC tools: program tokeniser/de-tokeniser and PRINT#/INPUT# data-file reader/writer
5
5
  Author-email: Robert Smallshire <robert@smallshire.org.uk>
6
6
  License-Expression: MIT
@@ -9,10 +9,9 @@ Project-URL: Repository, https://github.com/rob-smallshire/oaknut
9
9
  Project-URL: Issues, https://github.com/rob-smallshire/oaknut/issues
10
10
  Classifier: Development Status :: 3 - Alpha
11
11
  Classifier: Intended Audience :: Developers
12
- Classifier: Programming Language :: Python :: 3.11
13
12
  Classifier: Programming Language :: Python :: 3.12
14
13
  Classifier: Programming Language :: Python :: 3.13
15
- Requires-Python: >=3.11
14
+ Requires-Python: >=3.12
16
15
  Description-Content-Type: text/markdown
17
16
  License-File: LICENSE
18
17
  Requires-Dist: oaknut-exception>=10.0
@@ -92,7 +91,8 @@ Options:
92
91
  --help Show this message and exit.
93
92
 
94
93
  Commands:
95
- data Read and write BBC BASIC data files.
94
+ data Read and write BBC BASIC data files...
95
+ detect Identify whether each FILE is a tokenised BBC BASIC program.
96
96
  detokenise De-tokenise a stored BBC BASIC program into source text.
97
97
  number Prepend ascending line numbers to an unnumbered BBC BASIC...
98
98
  tokenise Tokenise BBC BASIC source text into a stored program.
@@ -129,11 +129,21 @@ Programs are handled by the functions `tokenise`, `detokenise`, and
129
129
  `number_lines`, all importable from `oaknut.basic`:
130
130
 
131
131
  ```python
132
- from oaknut.basic import tokenise, detokenise
132
+ from oaknut.basic import detokenise, tokenise
133
133
 
134
134
  program = tokenise('10 PRINT "HELLO"\n20 GOTO 10\n') # str -> bytes
135
135
  listing = detokenise(program) # bytes -> str
136
136
  assert tokenise(detokenise(program)) == program # byte-exact
137
+ print(program.hex(" "))
138
+ print(listing, end="")
139
+ ```
140
+
141
+ Output:
142
+
143
+ ```text
144
+ 0d 00 0a 0e 20 f1 20 22 48 45 4c 4c 4f 22 0d 00 14 0b 20 e5 20 8d 54 4a 40 0d ff
145
+ 10 PRINT "HELLO"
146
+ 20 GOTO 10
137
147
  ```
138
148
 
139
149
  When the program lives in a disc image, prefer the path-object wrappers
@@ -155,8 +165,16 @@ with datafile.open("scores.dat", "w") as f:
155
165
  f.write(3.5) # float -> real record
156
166
 
157
167
  with datafile.open("scores.dat", "r") as f:
158
- for value in f: # yields "ALICE", 42, 3.5
159
- print(value)
168
+ for value in f:
169
+ print(repr(value))
170
+ ```
171
+
172
+ Output:
173
+
174
+ ```text
175
+ 'ALICE'
176
+ 42
177
+ 3.5
160
178
  ```
161
179
 
162
180
  Strings use the BBC `acorn` character set by default, and reals convert through
@@ -68,7 +68,8 @@ Options:
68
68
  --help Show this message and exit.
69
69
 
70
70
  Commands:
71
- data Read and write BBC BASIC data files.
71
+ data Read and write BBC BASIC data files...
72
+ detect Identify whether each FILE is a tokenised BBC BASIC program.
72
73
  detokenise De-tokenise a stored BBC BASIC program into source text.
73
74
  number Prepend ascending line numbers to an unnumbered BBC BASIC...
74
75
  tokenise Tokenise BBC BASIC source text into a stored program.
@@ -105,11 +106,21 @@ Programs are handled by the functions `tokenise`, `detokenise`, and
105
106
  `number_lines`, all importable from `oaknut.basic`:
106
107
 
107
108
  ```python
108
- from oaknut.basic import tokenise, detokenise
109
+ from oaknut.basic import detokenise, tokenise
109
110
 
110
111
  program = tokenise('10 PRINT "HELLO"\n20 GOTO 10\n') # str -> bytes
111
112
  listing = detokenise(program) # bytes -> str
112
113
  assert tokenise(detokenise(program)) == program # byte-exact
114
+ print(program.hex(" "))
115
+ print(listing, end="")
116
+ ```
117
+
118
+ Output:
119
+
120
+ ```text
121
+ 0d 00 0a 0e 20 f1 20 22 48 45 4c 4c 4f 22 0d 00 14 0b 20 e5 20 8d 54 4a 40 0d ff
122
+ 10 PRINT "HELLO"
123
+ 20 GOTO 10
113
124
  ```
114
125
 
115
126
  When the program lives in a disc image, prefer the path-object wrappers
@@ -131,8 +142,16 @@ with datafile.open("scores.dat", "w") as f:
131
142
  f.write(3.5) # float -> real record
132
143
 
133
144
  with datafile.open("scores.dat", "r") as f:
134
- for value in f: # yields "ALICE", 42, 3.5
135
- print(value)
145
+ for value in f:
146
+ print(repr(value))
147
+ ```
148
+
149
+ Output:
150
+
151
+ ```text
152
+ 'ALICE'
153
+ 42
154
+ 3.5
136
155
  ```
137
156
 
138
157
  Strings use the BBC `acorn` character set by default, and reals convert through
@@ -10,13 +10,10 @@ description = "BBC BASIC tools: program tokeniser/de-tokeniser and PRINT#/INPUT#
10
10
  readme = "README.md"
11
11
  license = "MIT"
12
12
  license-files = ["LICENSE"]
13
- # oaknut-exception uses except* (PEP 654), so requiring it raises this
14
- # package's Python floor to 3.11.
15
- requires-python = ">=3.11"
13
+ requires-python = ">=3.12"
16
14
  classifiers = [
17
15
  "Development Status :: 3 - Alpha",
18
16
  "Intended Audience :: Developers",
19
- "Programming Language :: Python :: 3.11",
20
17
  "Programming Language :: Python :: 3.12",
21
18
  "Programming Language :: Python :: 3.13",
22
19
  ]
@@ -81,7 +81,7 @@ from oaknut.basic.tokens import (
81
81
  TOKEN_TO_KEYWORD,
82
82
  )
83
83
 
84
- __version__ = "13.4.0"
84
+ __version__ = "13.6.0"
85
85
 
86
86
  # Canonical load addresses for BBC BASIC programs on each host.
87
87
  # Programs saved by *SAVE on a real machine use these by default.
@@ -11,6 +11,8 @@ installed with its ``[cli]`` extra; the library core never imports it.
11
11
 
12
12
  from __future__ import annotations
13
13
 
14
+ import sys
15
+
14
16
  import click
15
17
  from asyoulikeit.cli import report_output
16
18
  from oaknut.cli.help import use_plain_help
@@ -358,7 +360,7 @@ def detect(ctx: click.Context, inputs, quiet: bool) -> None:
358
360
  """
359
361
  from oaknut.basic import detect as detect_blob
360
362
 
361
- streams = inputs if inputs else (click.get_binary_stream("stdin"),)
363
+ streams = inputs if inputs else (sys.stdin.buffer,)
362
364
  all_basic = True
363
365
  for stream in streams:
364
366
  result = detect_blob(stream.read())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oaknut-basic
3
- Version: 13.4.0
3
+ Version: 13.6.0
4
4
  Summary: BBC BASIC tools: program tokeniser/de-tokeniser and PRINT#/INPUT# data-file reader/writer
5
5
  Author-email: Robert Smallshire <robert@smallshire.org.uk>
6
6
  License-Expression: MIT
@@ -9,10 +9,9 @@ Project-URL: Repository, https://github.com/rob-smallshire/oaknut
9
9
  Project-URL: Issues, https://github.com/rob-smallshire/oaknut/issues
10
10
  Classifier: Development Status :: 3 - Alpha
11
11
  Classifier: Intended Audience :: Developers
12
- Classifier: Programming Language :: Python :: 3.11
13
12
  Classifier: Programming Language :: Python :: 3.12
14
13
  Classifier: Programming Language :: Python :: 3.13
15
- Requires-Python: >=3.11
14
+ Requires-Python: >=3.12
16
15
  Description-Content-Type: text/markdown
17
16
  License-File: LICENSE
18
17
  Requires-Dist: oaknut-exception>=10.0
@@ -92,7 +91,8 @@ Options:
92
91
  --help Show this message and exit.
93
92
 
94
93
  Commands:
95
- data Read and write BBC BASIC data files.
94
+ data Read and write BBC BASIC data files...
95
+ detect Identify whether each FILE is a tokenised BBC BASIC program.
96
96
  detokenise De-tokenise a stored BBC BASIC program into source text.
97
97
  number Prepend ascending line numbers to an unnumbered BBC BASIC...
98
98
  tokenise Tokenise BBC BASIC source text into a stored program.
@@ -129,11 +129,21 @@ Programs are handled by the functions `tokenise`, `detokenise`, and
129
129
  `number_lines`, all importable from `oaknut.basic`:
130
130
 
131
131
  ```python
132
- from oaknut.basic import tokenise, detokenise
132
+ from oaknut.basic import detokenise, tokenise
133
133
 
134
134
  program = tokenise('10 PRINT "HELLO"\n20 GOTO 10\n') # str -> bytes
135
135
  listing = detokenise(program) # bytes -> str
136
136
  assert tokenise(detokenise(program)) == program # byte-exact
137
+ print(program.hex(" "))
138
+ print(listing, end="")
139
+ ```
140
+
141
+ Output:
142
+
143
+ ```text
144
+ 0d 00 0a 0e 20 f1 20 22 48 45 4c 4c 4f 22 0d 00 14 0b 20 e5 20 8d 54 4a 40 0d ff
145
+ 10 PRINT "HELLO"
146
+ 20 GOTO 10
137
147
  ```
138
148
 
139
149
  When the program lives in a disc image, prefer the path-object wrappers
@@ -155,8 +165,16 @@ with datafile.open("scores.dat", "w") as f:
155
165
  f.write(3.5) # float -> real record
156
166
 
157
167
  with datafile.open("scores.dat", "r") as f:
158
- for value in f: # yields "ALICE", 42, 3.5
159
- print(value)
168
+ for value in f:
169
+ print(repr(value))
170
+ ```
171
+
172
+ Output:
173
+
174
+ ```text
175
+ 'ALICE'
176
+ 42
177
+ 3.5
160
178
  ```
161
179
 
162
180
  Strings use the BBC `acorn` character set by default, and reals convert through
File without changes
File without changes