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

Add @deparse macro #72

Merged
merged 10 commits into from
Oct 20, 2023
Merged

Conversation

hyrodium
Copy link
Collaborator

This PR fixes #59, closes #56.

@hyrodium
Copy link
Collaborator Author

hyrodium commented Oct 20, 2023

Hmm, not sure why the doctest fails..

julia> using Replay
[ Info: Precompiling Replay [dd78c5bf-19c4-4e9c-96ce-c3ec745c7812]

julia> @deparse 1+1
"1 + 1"

julia> @deparse sin(1f0+a)
"sin(1.0f0 + a)"

julia> @deparse f(x) = sin(x)/x  # Sometimes not work as expected
"f(x) = begin\n        sin(x) / x\n    end\n"

julia> versioninfo()
Julia Version 1.9.3
Commit bed2cd540a1 (2023-08-24 14:43 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD Ryzen 7 2700X Eight-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, znver1)
  Threads: 1 on 16 virtual cores

EDIT: I was forgetting to add @doc raw"..." to the docstring. I was confused because doctest(Replay, fix=true)does not fix the problem.

@terasakisatoshi
Copy link
Member

@hyrodium How about \\n?

image
 julia --project=docs -e '
            using Documenter: DocMeta, doctest
            using Replay
            DocMeta.setdocmeta!(Replay, :DocTestSetup, :(using Replay); recursive=true)
            doctest(Replay)'
image

@terasakisatoshi
Copy link
Member

nvm...

b0063c4 looks good to me

@terasakisatoshi
Copy link
Member

🎉

@terasakisatoshi terasakisatoshi merged commit b13fc47 into AtelierArith:main Oct 20, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

re-create PR
2 participants