Skip to content

Fix DIGITS token so it does not accept leading 0#1

Open
yasny wants to merge 1 commit intoEnigmaBridge:masterfrom
yasny:master
Open

Fix DIGITS token so it does not accept leading 0#1
yasny wants to merge 1 commit intoEnigmaBridge:masterfrom
yasny:master

Conversation

@yasny
Copy link

@yasny yasny commented Jul 13, 2017

Trying to parse the following output of read-resource(attributes-only=true) lead to null being returned.

{
    "outcome" => "success",
    "result" => {
        "management-major-version" => 1,
        "management-micro-version" => 0,
        "management-minor-version" => 7,
        "name" => "Unnamed Domain",
        "namespaces" => [],
        "product-name" => "EAP",
        "product-version" => "6.4.0.GA",
        "release-codename" => "Janus",
        "release-version" => "7.5.0.Final-redhat-21",
        "schema-locations" => []
    }
}

Problem seems to be that the 0 for the management-micro-version was being tokenized as a DIGITS, as opposed to a ZERO.

I changed the DIGITS token to not accept a leading 0, and that allowed me to parse the output correctly.

@ph4r05
Copy link
Member

ph4r05 commented Jul 13, 2017

Thanks for the PR! I am quite slammed at the moment and I would like to check it properly. Thanks for the provided example also! It may take a while to merge :/

Code is an adaptation of https://github.com/vsajip/json-ply for JBoss output grammar. The bug has to be present also there, hm.

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

Successfully merging this pull request may close these issues.

2 participants