Skip to content

ENHANCEMENT: new parameter for call_actions for not reversing #125

@goodguy00

Description

@goodguy00
  • parglare version: 0.12.0
  • Python version: 3.7.8
  • Operating System: fedora 31

Description

for some uses, a non-reversing actions execution can be of good use. i propose to extend the definition:

      def call_actions(node, context=None, reverse=True):

...

        if (reverse):
            # Recursive right to left, bottom up. Simulate LR reductions.
            for n in reversed(node):
                subresults.append(inner_call_actions(n))
            subresults.reverse()
        else:
            for n in (node):
                subresults.append(inner_call_actions(n))

Usecase

text to be parsed (here a tikz example)

     \draw [line width=2pt,color=wwffqq,domain=-4:12.44] plot(\x,{(-1.4356438- -0.96*\x)/0.26});

in this case, definig the attributes (like "domain") in the same line and using them in the "plot" is only possible in a non-reversed execution. also, coincidentially, then the "draw" directive will be called last allowing for actually executing the completely assembled plot-code.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions