Using perl's Regexp::Grammars, how do I make a capture dependent on $MATCH? -


I found a token like this:

   

And what I have to do is to delim2 and it can be set to the value of delim when I run it , delim2 is set but is never captured. I think this is an error in my argument: I am trying to sort this form:

  & lt; ALIAS = (PATTERN) & gt; Match for match, $ MATCH {ALIAS}  

and save this form: (? {MATCH {delim}}) like this

& lt; ALIAS = (MATCH {delim2}

match with the value of {MATCH {delim}}}> $ MATCH {delim} but it does not seem valid only. I can verify the works of my original token with & lt; delim2 = ((? {$ Die $ MATCH {delim}}) will die with the price, and, if I work hard I do the right capture and everything works So how do I know about achieving sensible results while having a dynamic pattern ?

(? {$ MATCH {delim}}) does not emphasize that in the input $ MATCH {delim} appears; Only that this is the correct value Regexp :: Grammars should have a "named-backference", such as perl \ k but it is (and You can not use \ k & lt; NAME & gt; because Regexp :: Grammars stores its results completely differently.)

You can do something like

  (?? {Quotemeta $ MATCH {delim}}) & lt; Delim2 = (? {$ MATCH {delim}}) & gt;  

That's awesome, but you can work in the test or you can go in and go to Parse :: RecDescent which is better support for such things or else You R: G Can start hacking on


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -