rewrite-clj
rewrite-clj copied to clipboard
Should regex node sexpr return a regex?
The regex-node constructor fn accepts a string-pattern.
It is called when parsing #regexa where regexa becomes the string-pattern.
The sexpr returns (list 're-pattern string-pattern).
Should it return (re-pattern string-pattern) (an actual regex?).
Notes
- If we do decide to do something about
sexprremember that regex implementations are platform specific. A reminder of that in the user guide should be considered. - Docstring for regex node constructor should clarify
string-patternusage and escaping. - Remember that in Clojure
(= #"myregex" #"myregex")returnsfalse. Someone searching through nodes viasexpr, would have to remember this fact.