Skip to content

Support args for ParserProtocol.setNextRule #36

Open
@introom

Description

@introom

Currently, we can only do setNextRule("ruleName"). But sometimes, the nextRule may in the form of :
ruleName :arg1 :arg2 = expr

As the argument is set by the caller, so, the currentRule needn't be in the form of term based Action(arg). It should directly be the data.
To accomplish this, I used the codeName to tell this apart. (I don't know if it's a good way to go or not.) When the codeName is None, it means the arg is already the pure data, which needn't be self._eval again.
A sample link:
https://github.com/introom/parsley/blob/master/ometa/interp.py#L154

To support rule invocation with argument, of course some other parts should be modified too.
I will discuss it later when this issue gets its attention.

@washort @habnabit

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