diff options
| author | Matthew Hall <hallmatthew314@gmail.com> | 2023-03-26 15:27:41 +1300 |
|---|---|---|
| committer | Matthew Hall <hallmatthew314@gmail.com> | 2023-03-26 15:27:41 +1300 |
| commit | ed57fac2de48c7a86536ae22c77540f787d49a81 (patch) | |
| tree | ef4e2b314a2e39c7327b01cf9fed09edbbc6b91d /spec/practical/words_spec.cr | |
| parent | 63dcfef9b99de484a737043afabe8c48d5105eb6 (diff) | |
Refactoring
Diffstat (limited to 'spec/practical/words_spec.cr')
| -rw-r--r-- | spec/practical/words_spec.cr | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/practical/words_spec.cr b/spec/practical/words_spec.cr index 5155881..35a4113 100644 --- a/spec/practical/words_spec.cr +++ b/spec/practical/words_spec.cr @@ -3,10 +3,10 @@ require "../spec_helper" include Parcom describe "Text surrounded by whitespace" do - ws_char = Parser(Char, Char).satisfy { |c| c.whitespace? } + ws_char = Parser(Char, Char).satisfy(&.whitespace?) normal_char = Parser(Char, Char).satisfy { |c| !c.whitespace? } - word = normal_char.some.map { |cs| cs.join } + word = normal_char.some.map(&.join) ws = ws_char.some words = ws.optional >> word.sep_by(ws) << ws.optional |
