bobheadxi / readable

👓 Opinionated Markdown formatter, featuring semantic line breaks
https://bobheadxi.dev/semantic-line-breaks/
20 stars 4 forks source link

reflow: already line-broken lists #14

Open bobheadxi opened 3 years ago

bobheadxi commented 3 years ago

input:

1. use the Golang [abstract syntax tree parser](https://golang.org/pkg/go/ast/)
  to identify "selectors", such as `my.value` (this approach did not have the
  `SELECT` syntax described early - an example of the initial proposal's syntax
  was simply `container.count - 1`. In this case, `container.count` is a valid Go selector
  that would be recognised by the AST parser)
2. evalaute the selectors using the `gojsonq` library
3. 3. perform expression arithmetic using the `govaluate` library with the selected
  values as [parameters to the expression](https://github.com/Knetic/govaluate#how-do-i-use-it)

got:

1. use the Golang [abstract syntax tree parser](https://golang.org/pkg/go/ast/)

to identify "selectors", such as `my.value` (this approach did not have the `SELECT` syntax described early - an example of the initial proposal's syntax was simply `container.count - 1`.
In this case, `container.count` is a valid Go selector that would be recognised by the AST parser) 2.
evalaute the selectors using the `gojsonq` library 3.
perform expression arithmetic using the `govaluate` library with the selected values as [parameters to the expression](https://github.com/Knetic/govaluate#how-do-i-use-it)

definitely wrong :( related: #7