Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Fix: sample with index number #45

@Bubobubobubobubo

Description

@Bubobubobubobubo

bd plays a sound but bd:2 does not play anything. You can investigate the issue by printing part of the tree as an expression is being evaluated by the mini-notation:

def visit_word_with_index(self, _node, children):
    word, index = children
    print(word, index)
    index = 0 if isinstance(index, Node) else index[0]
    return dict(type="word", value=word, index=index)

And then you'll see:

>>> s('bd')
bd <Node matching "">
~[((0, 1), (0, 1), {'s': 'bd'})] ...~
>>> s('bd:2')
bd [2]
bd <Node matching "">
~[((0, 1), (0, 1), {'s': {'n': 2, 's': 'bd'}})] ...~

Any ideas? I'm learning parsimonious to try to fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions