Comments (3)
Yeah, the code that parses docstrings is pretty brittle, it looks at the next line after a defn and if it sees a quote as the first non-whitespace character it assumes it's a docstring.
Work's in progress to find a more robust solution, keep an eye on https://github.com/fogus/marginalia/issues#issue/3 to follow the progress.
from marginalia.
Until we work out a better parser a fix for your particular problem is to change your code to:
(defn parse-bool [v]
(condp = (.trim (text v))
"0" false
"1" true
"throw exception here"))
from marginalia.
I ended up going down the rabbit hole on trying to use the c.l.LispParser, so here's a temporary fix.
See the problem-cases.general namespace for the working example.
from marginalia.
Related Issues (20)
- Markdown extension for linking to a function in docstrings and comments HOT 1
- chokes on Clojure 1.7.0 HOT 8
- Marginalia waits a long time for agents to shut down HOT 2
- Every 3rd time I run, I get an exception HOT 3
- Explore the use of Instaparse
- Processing reader conditionals broken HOT 9
- `lein marg` fails when a map value symbol contains a double colon HOT 8
- Incompatibility in matchSymbol with Clojure 1.9.0-beta1 HOT 4
- lein marg fails under clojure 1.9.* HOT 11
- Does not take into account `:source-paths` HOT 1
- Markdown target HOT 4
- :extend-via-metadata in protocols breaks Marginalia HOT 3
- docco url in README.md HOT 1
- Add instructions for `deps.edn` projects HOT 1
- Transfer to clj-commons? HOT 1
- Make [[docstring-links]] into links HOT 1
- [Idea] Respect .gitignore
- Support blocking search engines (support custom <head> content?) HOT 3
- Update the website link in repo's "About" section HOT 1
- [Idea] Ways to style the docs based on metadata on `def`s HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from marginalia.