aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hall <hallmatthew314@gmail.com>2023-03-14 23:19:40 +1300
committerMatthew Hall <hallmatthew314@gmail.com>2023-03-14 23:19:40 +1300
commit5e2a191612bc62582603280fbb01f881d7b66003 (patch)
tree0fbb47cffb4d639201050f533e1d31cb9fbd230b
parent9407354b36fbae0f7349ea2e2c47f847fee03f11 (diff)
Hell if i knowinterface-experiment
-rw-r--r--spec/parcom_spec.cr13
1 files changed, 7 insertions, 6 deletions
diff --git a/spec/parcom_spec.cr b/spec/parcom_spec.cr
index 25ae2e9..9cf5ac6 100644
--- a/spec/parcom_spec.cr
+++ b/spec/parcom_spec.cr
@@ -728,14 +728,15 @@ describe "Practical use" do
# TODO: Figure out why mapping on this parser breaks
# initialization of `body`.
- word_chars = Some.new(non_space)
- ws = Some.new(space)
+ word_chars = Some.new(non_space).map { |cs| cs.join }.as(Parser(Char, String))
+ ws = Some.new(space).as(Parser(Char, Array(Char)))
bookend = Optional.new(ws)
- body = SepBy.new(word_chars, ws)
- tokenizer = (bookend >> body << bookend).map do |arrs|
- arrs.map { |chars| chars.join }
- end
+ body = SepBy.new(word_chars, ws).as(Parser(Char, Array(String)))
+ tokenizer = bookend >> body << bookend
+ #tokenizer = (bookend >> body << bookend).map do |arrs|
+ # arrs.map { |chars| chars.join }
+ #end
good_strings = [
"test with no trailing whitespace",