in reply to Re: Parsing a config file with braces and nested braces
in thread Parsing a config file with braces and nested braces

This seems to work pretty well, except that it seems to get stuck when it parses into the next rule. I realized that I could have expanded my data example a bit. The rules I am trying to parse are sequential in the larry{} section. While your code works awesome, it seems to trip up just a little when encountering the next rule. Output example with my updated example above...
{ bob => { ed => { larry => { rule5 => { "action" => "allow", "application" => "[ any ]", "category" => "[ any ]", "destination" => "[ any ]", "from" => "[ prod-L3 ]", "hip-profiles" => "[ any ]", "log-end" => "yes", "log-setting" => "orion_log", "log-start" => "no", "negate-destination" => "no", "negate-source" => "no", "option" => { "action" + => "allow", "application" + => "[ any ]", "category" + => "[ any ]", "destination" + => "[ any ]", "disable-server-respo +nse-inspection" => "no", "from" + => "[ prod-L3 ]", "hip-profiles" + => "[ any ]", "log-end" + => "yes", "log-setting" + => "orion_log", "log-start" + => "no", "negate-destination" + => "no", "negate-source" + => "no", "service" + => "[ any ]", "source" + => "[ any ]", "source-user" + => "[ any ]", "to" + => "[ corp-L3 ]", "}" + => "rule6 { \n opt ion { \n disable-server-response-inspection no", }, "service" => "[ any ]", "source" => "[ any ]", "source-user" => "[ any ]", "tag" => "[ some_tag ]", "to" => "[ corp-L3 ]", }, }, }, }, }

Replies are listed 'Best First'.
Re^3: Parsing a config file with braces and nested braces
by BrowserUk (Patriarch) on Jan 07, 2015 at 20:25 UTC
    except that it seems to get stuck when it parses into the next rule.

    Yes. I see the problem. But I do not see an immediate solution and I'm rather involved in something else at the moment. (Sorry!)

    If you have other avenues of attack, pursue them rather than wait for this; as it might be a while.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.