diff --git a/pyhocon/config_parser.py b/pyhocon/config_parser.py index 9e202362..27366a5c 100644 --- a/pyhocon/config_parser.py +++ b/pyhocon/config_parser.py @@ -236,7 +236,7 @@ def include_config(token): value_expr = number_expr | true_expr | false_expr | null_expr | string_expr - include_expr = (Keyword("include", caseless=True).suppress() - ( + include_expr = (Keyword("include", caseless=True).suppress() + ( quoted_string | ( (Keyword('url') | Keyword('file')) - Literal('(').suppress() - quoted_string - Literal(')').suppress()))) \ .setParseAction(include_config) diff --git a/tests/test_config_parser.py b/tests/test_config_parser.py index a0927f1b..72d01147 100644 --- a/tests/test_config_parser.py +++ b/tests/test_config_parser.py @@ -1153,6 +1153,16 @@ def test_include_substitution(self): assert config['x'] == 42 assert config['y'] == 42 + def test_var_with_include_keyword(self): + config = ConfigFactory.parse_string( + """ + include-database=true + """) + + assert config == { + 'include-database': True + } + def test_substitution_override(self): config = ConfigFactory.parse_string( """