instaparse

If you're not trampolining your parser, why bother getting up in the morning?
Sigve 2021-04-23T06:30:27.026800Z

If i understand correctly, :auto-whitespace :standard inserts <whitespace>? rules. So that for the parser

(def words-and-numbers-auto-whitespace
  (insta/parser
    "sentence = token+
     <token> = word | number
     word = #'[a-zA-Z]+'
     number = #'[0-9]+'"

    :auto-whitespace :standard))
(words-and-numbers-auto-whitespace "abc 123 45 de") and (words-and-numbers-auto-whitespace "abc123 45de") produces the same result. Is there any method of instead inserting non-optional whitespace rules, which in this case would disallow "abc123 45de"`?

sova-soars-the-sora 2021-04-23T19:23:38.028100Z

@sigve.nordgaard the desired result is only letters and only numbers together in sequence? You could have tokens-numbers and tokens-letters and a sentence can be tokens-numbers+ | tokens-letters+

sova-soars-the-sora 2021-04-23T19:24:13.028600Z

If I have understood the question. That would only allow contiguous digits or contiguous characters, not a mix