Merge branch 'rinderknecht@preproc' into 'dev'
Bug fix: the environment has to be threaded through #include See merge request ligolang/ligo!576
This commit is contained in:
commit
11f4e6e3a6
10
vendors/Preprocessor/Preproc.mll
vendored
10
vendors/Preprocessor/Preproc.mll
vendored
@ -506,13 +506,11 @@ rule scan state = parse
|
|||||||
incl_buf.lex_curr_p <-
|
incl_buf.lex_curr_p <-
|
||||||
{incl_buf.lex_curr_p with pos_fname = incl_file} in
|
{incl_buf.lex_curr_p with pos_fname = incl_file} in
|
||||||
let state = {state with incl = incl_chan::state.incl} in
|
let state = {state with incl = incl_chan::state.incl} in
|
||||||
let state' =
|
let state' = {state with mode=Copy; trace=[]} in
|
||||||
{state with env=Env.empty; mode=Copy; trace=[]} in
|
|
||||||
let state' = scan (push_dir incl_dir state') incl_buf in
|
let state' = scan (push_dir incl_dir state') incl_buf in
|
||||||
let state = {state with incl = state'.incl} in
|
let state = {state with env=state'.env; incl=state'.incl} in
|
||||||
let path =
|
let path = if path = "" then base
|
||||||
if path = "" then base
|
else path ^ Filename.dir_sep ^ base in
|
||||||
else path ^ Filename.dir_sep ^ base in
|
|
||||||
print state (sprintf "\n# %i \"%s\" 2" (line+1) path);
|
print state (sprintf "\n# %i \"%s\" 2" (line+1) path);
|
||||||
scan state lexbuf
|
scan state lexbuf
|
||||||
| "if" ->
|
| "if" ->
|
||||||
|
Loading…
Reference in New Issue
Block a user