pyhocon icon indicating copy to clipboard operation
pyhocon copied to clipboard

Parsing bug when key start with months prefix with pyparsing>=3.0.0

Open etiennebrateau opened this issue 2 years ago • 0 comments

import pyhocon

parser = pyhocon.ConfigFactory()
conf2 = """
x: {
    months_key1: 6
    months_key2: 1
}
"""
result = parser.parse_string(conf2)
assert result.get("x").get("months_key1") == 6
assert result.get("x").get("months_key2") == 1

This code pass with pyparsing <3.0.0 and fails with pyparsing>3.0.0 because the months is not interpreted as part of the other key but as time specifier

etiennebrateau avatar Feb 14 '23 17:02 etiennebrateau