Skip to content

Some problems with rules that include variables #9

Description

@ksmolyanin

There are some problems with rules that include variables. Example:
user_structure: tag_begin pws tag_name:simple_name save_tag_name:"" (rws attribute:user_attribute (rws attribute:user_attribute)*)? (rws tag_stub | (pws tag_end content:template_content? tag_begin pws end_tag_mark pws "$tag_name" pws tag_end)) function save_tag_name (&$res, $sub) { $res['content'][] = '{}'; $res['content'][] = $res['tag_name']['text']; } function attribute (&$res, $sub) { $res['content'][] = $sub['content']; } function content (&$res, $sub) { $res['content'][] = array ( '"', 'content', $sub['content'] ); }
Here is impossible to declate function "tag_name" to save the tag name because this name is used as variable at the end of the rule.
If I declare function tag_name (&$res, $sub) then variable $tag_name doesn't match!

Another bug is appeared if use variable "name" instead of variable "tag_name". With "name" it doesn't work at all!
Probably it is because parser tree in $res already has member "name" .. but who knows about this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions