This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-12-20
Channels
- # adventofcode (140)
- # beginners (107)
- # boot (120)
- # boot-dev (1)
- # clara (13)
- # cljs-dev (9)
- # clojure (107)
- # clojure-argentina (5)
- # clojure-art (16)
- # clojure-dev (23)
- # clojure-greece (19)
- # clojure-italy (5)
- # clojure-russia (2)
- # clojure-serbia (3)
- # clojure-spec (27)
- # clojure-sweden (1)
- # clojure-uk (15)
- # clojurescript (134)
- # cursive (5)
- # data-science (10)
- # datomic (23)
- # duct (28)
- # fulcro (48)
- # garden (5)
- # hoplon (2)
- # instaparse (1)
- # klipse (7)
- # leiningen (8)
- # lumo (36)
- # off-topic (72)
- # om (4)
- # onyx (37)
- # perun (4)
- # re-frame (64)
- # reagent (86)
- # remote-jobs (1)
- # shadow-cljs (59)
- # spacemacs (16)
- # sql (1)
- # uncomplicate (6)
- # unrepl (90)
say I have the following grammar:
(defn make-layout-parser-internal []
(insta/parser
"layout-string = col-delim (col-align col-delim)+
col-delim = (col-fill | col-padding)*
col-fill = ('F' | 'f')
col-padding = #'[^\\[\\]fF]*'
col-align = <'['> ('L' | 'l' | 'C' | 'c' | 'R' | 'r') <']'>"))
but I want to make a slight modification to it in a certain context. In essence I have two grammars with just a slight differentce between them and depending on the surrounding (non instaparse related) programming context I would like to parse using either grammar a or grammar b. Would I need to define two distinct grammars as per the above or is there some good way to share most of the grammar and have just a slight modification? In my specific case I would have a difference in the col-align
value only