diff options
| author | Matthew Hall <hallmatthew314@gmail.com> | 2023-03-26 15:42:56 +1300 |
|---|---|---|
| committer | Matthew Hall <hallmatthew314@gmail.com> | 2023-03-26 15:42:56 +1300 |
| commit | fc1afdcb72d786836479367ef42d7d82069aaf97 (patch) | |
| tree | aa442410a45e31bb23c1b88d88bdb0c969f3dab1 /src | |
| parent | f156d80cc3c80385456bc3ec80adb5ad892f5039 (diff) | |
More refactoring
Diffstat (limited to 'src')
| -rw-r--r-- | src/parcom/parser.cr | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parcom/parser.cr b/src/parcom/parser.cr index 57c7b44..af486c4 100644 --- a/src/parcom/parser.cr +++ b/src/parcom/parser.cr @@ -456,8 +456,8 @@ module Parcom # instance of `self`. It will succeed if it can parse an instance of `self` # that is not followed by any `sep` instances. def sep_by(sep : Parser(T, _)) : Parser(T, Array(U)) - (self + (sep >> self).many).map do |tup| - tup.last.unshift(tup.first) + (self + (sep >> self).many).map do |head, tail| + tail.unshift(head) end.named("<#{@name}> sep by <#{sep.name}>") end end |
