Skip to content

Commit

Permalink
@seq macro discard whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
gkappler committed Aug 10, 2020
1 parent a9f87af commit 559c6be
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/CombinedParsers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1045,14 +1045,15 @@ export @seq
@seq(x...)
Create a sequence interleaved with whitespace (horizontal or vertical).
The result_type is omitting whitespace.
"""
macro seq(x...)
r = if length(x)==1
x
else
quote
x_ = [$(x...)]
sSequence( (i < lastindex(x_) ? (e*CombinedParsers.Regexp.whitespace_newline) : e for (i,e) in enumerate(x_))...)
sSequence( (i < lastindex(x_) ? (e*CombinedParsers.Regexp.whitespace_newline)[1] : e for (i,e) in enumerate(x_))...)
end
end
esc(r)
Expand Down

2 comments on commit 559c6be

@gkappler
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/19284

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.2 -m "<description of version>" 559c6bed0e2c7013ceee69946c6eae09403d6ac2
git push origin v0.1.2

Please sign in to comment.