chimpler / pyhocon

HOCON parser for Python
Apache License 2.0
508 stars 121 forks source link

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

Open etiennebrateau opened 1 year ago

etiennebrateau commented 1 year ago
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