2017-06-25 17:23:20 +02:00
# Go Liquid Template Parser
`goliquid` is a Go implementation of the [Shopify Liquid template language ](https://shopify.github.io/liquid/tags/variable/ ), for use in [Gojekyll ](https://github.com/osteele/gojekyll ).
## Status
- [ ] Basics
- [ ] Constants
2017-06-26 04:59:33 +02:00
- [x] Variables
2017-06-25 17:23:20 +02:00
- [ ] Operators
- [ ] Arrays
- [ ] Whitespace Control
- [ ] Tags
- [ ] Comment
- [ ] Control Flow
2017-06-26 02:11:29 +02:00
- [x] if/else/elsif
- [x] unless
- [ ] case/when
2017-06-25 17:23:20 +02:00
- [ ] Iteration
- [ ] for
- [ ] limit, offset, range, reversed
- [ ] break, continue
- [ ] loop variables
- [ ] tablerow
- [ ] cycle
- [ ] Raw
- [ ] Variable
- [ ] Assign
- [ ] Capture
- [ ] Filters
## Install
`go get -u github.com/osteele/goliquid`
2017-06-25 18:36:28 +02:00
## Contribute
### Setup
2017-06-25 17:23:20 +02:00
```bash
go get golang.org/x/tools/cmd/stringer
2017-06-25 22:21:31 +02:00
go install golang.org/x/tools/cmd/goyacc
2017-06-25 17:23:20 +02:00
```
2017-06-25 18:36:28 +02:00
Install Ragel. On macOS: `brew install ragel` .
### Workflow
2017-06-25 17:23:20 +02:00
```bash
go generate
2017-06-25 18:36:28 +02:00
go test
2017-06-25 17:23:20 +02:00
```
2017-06-25 18:36:28 +02:00
Test just the scanner:
```bash
ragel -Z scanner.rl & & go test -run TestExpressionParser
2017-06-25 22:21:31 +02:00
```
## Attribution
Michael Hamrah's [Lexing with Ragel and Parsing with Yacc using Go ](https://medium.com/@mhamrah/lexing-with-ragel-and-parsing-with-yacc-using-go-81e50475f88f ) was essential to understanding `go yacc` .