This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-23
Channels
- # announcements (5)
- # aws (4)
- # babashka (141)
- # beginners (139)
- # calva (35)
- # cider (5)
- # clj-kondo (27)
- # cljsrn (20)
- # clojure (37)
- # clojure-czech (5)
- # clojure-dev (26)
- # clojure-europe (11)
- # clojure-germany (1)
- # clojure-italy (1)
- # clojure-nl (3)
- # clojure-spec (17)
- # clojure-uk (16)
- # clojurescript (2)
- # conjure (1)
- # cursive (6)
- # datomic (20)
- # defnpodcast (1)
- # emacs (15)
- # fulcro (26)
- # honeysql (2)
- # instaparse (3)
- # jackdaw (4)
- # jobs (2)
- # lsp (70)
- # luminus (2)
- # meander (16)
- # missionary (2)
- # other-languages (151)
- # pathom (6)
- # portkey (13)
- # re-frame (13)
- # reagent (2)
- # reitit (43)
- # releases (1)
- # remote-jobs (1)
- # reveal (5)
- # rum (2)
- # sci (15)
- # shadow-cljs (37)
- # spacemacs (4)
- # tools-deps (8)
- # vim (20)
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"
`?@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+
If I have understood the question. That would only allow contiguous digits or contiguous characters, not a mix