Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some problems with rules that include variables #9

Open
ksmolyanin opened this issue Jul 28, 2011 · 0 comments
Open

Some problems with rules that include variables #9

ksmolyanin opened this issue Jul 28, 2011 · 0 comments

Comments

@ksmolyanin
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant