This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-24
Channels
- # aws (3)
- # aws-lambda (1)
- # beginners (16)
- # boot (36)
- # cider (3)
- # cljs-dev (90)
- # cljsjs (1)
- # cljsrn (27)
- # clojure (240)
- # clojure-austin (1)
- # clojure-berlin (3)
- # clojure-dusseldorf (2)
- # clojure-france (2)
- # clojure-germany (12)
- # clojure-russia (19)
- # clojure-spec (20)
- # clojure-uk (56)
- # clojurescript (218)
- # clojurex (1)
- # cursive (21)
- # datomic (10)
- # events (1)
- # hoplon (18)
- # instaparse (19)
- # jobs-discuss (3)
- # lein-figwheel (3)
- # luminus (3)
- # lumo (14)
- # off-topic (4)
- # om (76)
- # onyx (67)
- # protorepl (12)
- # re-frame (54)
- # reagent (35)
- # ring (2)
- # spacemacs (5)
- # specter (2)
- # sql (11)
- # untangled (144)
- # yada (34)
related:
symbol = #'(?!(->|=)\\b)[+/*<>:&|=^?%#~!-]+'
oh awesome, let me try that now
I had meant to circle back and fix all that stuff on the bottom...
@aengelberg yeah, that's pretty awesome. Thanks a ton. I guess I have some work to do
Its cut nearly in half on JS
just curious, does Elm allow newlines pretty much anywhere there can be whitespace? if so, I would recommend making a universal ws
and ows
(optional whitespace) that allows whitespace, newlines, and comments, which you can then spam in your grammar anytime you would use <break>
.
whitespace and comments are sometimes the trickiest parts of grammar perf
Its pretty flexible with newlines yeah. It does care about indentation (which I haven't attempted to model in anyway). Are you saying that break
performs poorly or that it would be easier to maintain if I just settled on fewer whitespace tokens
I don't think anything's wrong with break
, but you might run into false negatives i.e. valid Elm code that doesn't parse properly
and making ws easier to reason about makes you less likely to fall into ambiguity traps like two adjacent ws parsers
yeah that's a good point
break probably can go. It was just the result of trial and error when I first picked up the parser, I shouldn't feel particularly attached to it if I can just use ws everywhere
thanks again. This is far more support than I expected
No problem
I think it might also make sense for me to roll comments into a rule similar to that
they too can appear anywhere
Agreed. Your usage of single line comments seemed kind of arbitrary though admittedly I'm not familiar with Elm
yeah its totally arbitrary. I've punted on all inline comments atm
the only challenge was modeling them in a meaningful way. I wanted to be able to convert the tree back into code and preserve the comments, or be able to include data about comments in queries against the parse tree