#How to tell if Foo is in Array in case?

1 messages · Page 1 of 1 (latest)

torn vigil
#

I was working on adding escape sequences to jot, and I have this currently "`" -> { parse_inline(rest, text <> "`", acc) } "*" -> { parse_inline(rest, text <> "*", acc) } "_" -> { parse_inline(rest, text <> "_", acc) } "[" -> { parse_inline(rest, text <> "[", acc) } "#" -> { parse_inline(rest, text <> "#", acc) } _ -> parse_inline(list.append([c], rest), text <> "\\", acc) but that seems not great, and there should be a better way to do it. Is this the best way to handle it the handled cases are only for testing but there would end up being around 30 cases. Or is there some other idea that I am not thinking of?

viral peak
#
  case c {
    "`" | "*" | "_" | ... -> parse_inline(rest, text <> c, acc)
    _ -> ...
  }