Skip to content

Commit

Permalink
Allow empty spa.Actions.
Browse files Browse the repository at this point in the history
Fixes #107.
  • Loading branch information
jgosmann committed Nov 9, 2017
1 parent fb6dc0f commit ecaf806
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ Release History
(`#61 <https://github.com/nengo/nengo_spa/pull/99>`_,
`#28 <https://github.com/nengo/nengo_spa/issues/80>`_)

**Fixed**

- Allow the ``spa.Actions`` string to be empty.
(`#107 <https://github.com/nengo/nengo_spa/issues/107>`_,
`#109 <https://github.com/nengo/nengo_spa/pull/109>`_)


0.3.1 (November 7, 2017)
========================
Expand Down
2 changes: 1 addition & 1 deletion nengo_spa/compiler/grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def read(self, tokens):
match.extend(Terminal(type=tk.DEDENT).read(tokens))
else:
# Main block is just a single line of Python without indentation
match = AtLeastOne(action).read(tokens)
match = AnyNumber(action).read(tokens)
return match

def __str__(self):
Expand Down
1 change: 1 addition & 0 deletions nengo_spa/compiler/tests/test_grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def effect_tree(source, target):


@pytest.mark.parametrize('code, parse_tree', [
('', []),
('a -> b', [effect_tree('a', 'b')]),
('a.x -> b.y', [effect_tree('a.x', 'b.y')]),
('a -> b; c -> d', [
Expand Down

0 comments on commit ecaf806

Please sign in to comment.