Skip to content

Commit

Permalink
Fix to handle comments in include
Browse files Browse the repository at this point in the history
  • Loading branch information
moyner committed Mar 7, 2024
1 parent 2a0fce2 commit 0a0541a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/InputParser/parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,19 @@ function parse_data_file!(outer_data, filename, data = outer_data;
data = new_section(outer_data, m)
skip_mode = m in skip
elseif m == :INCLUDE
next = strip(readline(f))
next = readline(f)
if occursin("--", next)
# Strip comments
next = next[1:findfirst("--", next)[1]-1]
end
next = strip(next)
if endswith(next, '/')
next = rstrip(next, '/')
else
readline(f)
end
include_path = clean_include_path(basedir, next)
parser_message(cfg, outer_data, "$m", "Including file: $include_path. Basedir: $basedir with INCLUDE = $next)")
parser_message(cfg, outer_data, "$m", "Including file: $include_path. Basedir: $basedir with INCLUDE = $next")
parse_data_file!(
outer_data, include_path, data,
verbose = verbose,
Expand Down

0 comments on commit 0a0541a

Please sign in to comment.