Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not enter macro state with macros disabled #297

Merged
merged 1 commit into from
Apr 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Do not enter macro state with macros disabled
Issue: #290
  • Loading branch information
vstakhov committed Apr 20, 2024
commit bb92fa40d3c0199ed9ba99c883ce4842fd9e6144
10 changes: 3 additions & 7 deletions src/ucl_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1372,12 +1372,8 @@ ucl_parse_key (struct ucl_parser *parser, struct ucl_chunk *chunk,

p = chunk->pos;

if (*p == '.') {
/* It is macro actually */
if (!(parser->flags & UCL_PARSER_DISABLE_MACRO)) {
ucl_chunk_skipc (chunk, p);
}

if (*p == '.' && !(parser->flags & UCL_PARSER_DISABLE_MACRO)) {
ucl_chunk_skipc (chunk, p);
parser->prev_state = parser->state;
parser->state = UCL_STATE_MACRO_NAME;
*end_of_object = false;
Expand Down Expand Up @@ -1415,7 +1411,7 @@ ucl_parse_key (struct ucl_parser *parser, struct ucl_chunk *chunk,
*end_of_object = true;
return true;
}
else if (*p == '.') {
else if (*p == '.' && !(parser->flags & UCL_PARSER_DISABLE_MACRO)) {
ucl_chunk_skipc (chunk, p);
parser->prev_state = parser->state;
parser->state = UCL_STATE_MACRO_NAME;
Expand Down
Loading