Skip to content

Commit 51b4c0d

Browse files
committed
Fix inconsistent out-of-sequence-error behavior, bump patch version
1 parent 0766de0 commit 51b4c0d

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)'s.
1616
- A `prune` macro
1717
- More modifiers, e.g. Langton's Ant and Deficient/genext -- also hex (although hex symmetries are scary)
1818

19+
## [0.6.3] 2020-11-07
20+
### Fixed
21+
- In a transition where every state is labeled with a direction (so that missing states can be filled in with `any`),
22+
a state labeled with a compass-direction range will no longer throw an error if this range doesn't start immediately
23+
after where the previous state ended. (It was inconsistent: something like `0, N blah, SW bluh; 3` was allowed,
24+
but not `0, N blah, SW..Nw bluh; 3`)
25+
1926
## [0.6.2] 2020-11-06
2027
### Added
2128
- `blahblah, something cdir..cdir, blahblah` is now allowed as an alternative to `cdir..cdir something`

nutshell/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '0.6.2'
1+
__version__ = '0.6.3'
22
from .common import *
33
from .segment_types.table import _napkins as napkin
44
from .segment_types.table._napkins import Napkin, OrthNapkin, HexNapkin

nutshell/segment_types/table/_transformer.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,10 @@ def main(self, children, meta):
294294
if idx != crange[0]:
295295
if idx == 1:
296296
idx = offset_initial = crange[0]
297-
else:
297+
elif crange[0] < idx and (
298+
not offset_initial or
299+
offset_initial and pure_idx > self._tbl.trlen
300+
):
298301
nbhd = self._tbl.neighborhood.inv
299302
raise SyntaxErr(
300303
(loc.ctx.lno, loc.ctx.start, len(a) + loc.ctx.start),
@@ -331,8 +334,10 @@ def main(self, children, meta):
331334
if cdir != idx:
332335
if idx == 1 and not offset_initial:
333336
offset_initial = cdir
334-
elif cdir < idx and (not offset_initial or
335-
offset_initial and pure_idx > self._tbl.trlen):
337+
elif cdir < idx and (
338+
not offset_initial or
339+
offset_initial and pure_idx > self._tbl.trlen
340+
):
336341
raise SyntaxErr(
337342
loc.ctx,
338343
'Out-of-sequence compass direction '

0 commit comments

Comments
 (0)