diff options
| author | Matthew Hall <hallmatthew314@gmail.com> | 2023-03-13 18:20:48 +1300 |
|---|---|---|
| committer | Matthew Hall <hallmatthew314@gmail.com> | 2023-03-13 18:20:48 +1300 |
| commit | 60f7fc8b7d960ef4266ab532efb282bb17a0c1c5 (patch) | |
| tree | f553cafb222705cedae4ac0e5ed2813498855d58 | |
| parent | a4430f0fb86871ad15b1fce586f69a1486dc7844 (diff) | |
Small refactor to Many
| -rw-r--r-- | src/parcom/many.cr | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/parcom/many.cr b/src/parcom/many.cr index d76fc91..a734c63 100644 --- a/src/parcom/many.cr +++ b/src/parcom/many.cr @@ -21,13 +21,10 @@ module Parcom loop do result = @p.parse?(tokens) + break unless !result.nil? && result.tokens != tokens - if !result.nil? && result.tokens != tokens - parsed << result.value - tokens = result.tokens - else - break - end + parsed << result.value + tokens = result.tokens end Result.new(tokens, parsed) |
