JunoLab / Weave.jl

Scientific reports/literate programming for Julia
http://weavejl.mpastell.com
MIT License
824 stars 95 forks source link

fixes #263 #364

Closed aviatesk closed 4 years ago

aviatesk commented 4 years ago

@pfitzseb Can you kindly review this (especially a part around task_local_storage) ? I think we can fix line numbers as well, but I guess we need to fix (or at least review) our parser first.

aviatesk commented 4 years ago

borrowed the idea to unwrap LoadError as https://github.com/julia-vscode/julia-vscode/pull/1331

pfitzseb commented 4 years ago

This looks correct to me.

You could consider returning an Expr from parse_input and then iterating over that -- might be better for handling parser errors, maybe. If you want to do that, there are some useful utilities here and here. You need to

  1. set TLS[:SOURCE_PATH] properly.
  2. fix LNNs if working with expressions
  3. and, ideally, also cd into the right directory

to run user code.

aviatesk commented 4 years ago

Thanks @pfitzseb , for now I would like to go with include_string since it seems to show parsing error as well. I may iterate over it in the future.

and, ideally, also cd into the right directory

this is actually good point, I added.

Will merge this once CI passes.