Utilities to manipulate Elixir source code
APACHE-2.0 License
Published by doorgan over 2 years ago
skip
(Thanks to @NickNeck)direction
to zip
(Thanks to @NickNeck):__block__
nodesPublished by doorgan over 2 years ago
traverse_while
(Thanks to @NickNeck)traverse
now traverses subtrees if given a non top
Published by doorgan almost 3 years ago
to_string/2
now supports options for Code.quoted_to_algebra
, like locals_without_parens
get_range/2
no longer considers comments when calculating the range. This can be enabled by passing the include_comments: true
optionSourceror.Patch
with utilities to generate patches for the most common rewriting operationsSourceror.Identifier
is now publicPublished by doorgan almost 3 years ago
Published by doorgan almost 3 years ago
Published by doorgan almost 3 years ago
Published by doorgan about 3 years ago
Published by doorgan about 3 years ago
Published by doorgan about 3 years ago
Published by doorgan about 3 years ago
get_range/1
now properly handles naked AST lists, like the onesa -> b
.Published by doorgan about 3 years ago
get_range/1
now handles partial keyword list syntax instead of crashing.Published by doorgan about 3 years ago
down/1
now correctly uses nil
as the right siblings if the branch node has a single child.Sourceror.patch_string/2
format: :splicing
option to Sourceror.to_string/2
Sourceror.to_string/2
won't produce invalid Elixir codeSourceror.get_range/1
will take the leading comments intoThis release introduces some breaking changes, as the way comments are
handled by the library has been fundamentally changed.
to_string
no longer requires line number corrections toprewalk/2
and prewalk/3
.parse_string
won't warn on unnecesary quotes.Sourceror.PostwalkState
was renamed toSourceror.TraversalState
to make it more generic for other kinds ofget_line_span
was removed in favor of using get_range
andline_correction
field was removed as it is noget_range
now properly returns ranges that map a node toThe changelog for v0.5 releases can be found in the v0.5.0
tag.