1
0
mirror of https://github.com/danog/liquid.git synced 2024-11-30 09:48:59 +01:00
Go to file
2017-06-25 20:47:31 -04:00
.gitignore Yacc expression parsing 2017-06-25 16:21:31 -04:00
chunk_ast.go Functional is constructed within parser, not scanner 2017-06-25 20:47:31 -04:00
chunk_parser_test.go Functional is constructed within parser, not scanner 2017-06-25 20:47:31 -04:00
chunk_parser.go Implement {% unless %} 2017-06-25 20:11:29 -04:00
chunk_scanner.go Implement {% else %}, {% elsif %} 2017-06-25 17:26:14 -04:00
chunktype_string.go Initial 2017-06-25 11:23:20 -04:00
control_tags.go Implement {% unless %} 2017-06-25 20:11:29 -04:00
expression_parser_test.go Yacc expression parsing 2017-06-25 16:21:31 -04:00
expression_parser.y Functional is constructed within parser, not scanner 2017-06-25 20:47:31 -04:00
README.md Implement {% unless %} 2017-06-25 20:11:29 -04:00
render.go Implement {% unless %} 2017-06-25 20:11:29 -04:00
scanner.go Functional is constructed within parser, not scanner 2017-06-25 20:47:31 -04:00
scanner.rl Functional is constructed within parser, not scanner 2017-06-25 20:47:31 -04:00
tokens.go Yacc expression parsing 2017-06-25 16:21:31 -04:00
y.go Functional is constructed within parser, not scanner 2017-06-25 20:47:31 -04:00

Go Liquid Template Parser

goliquid is a Go implementation of the Shopify Liquid template language, for use in Gojekyll.

Status

  • Basics
    • Constants
    • Variables
    • Operators
    • Arrays
    • Whitespace Control
  • Tags
    • Comment
    • Control Flow
      • if/else/elsif
      • unless
      • case/when
    • 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

Contribute

Setup

go get golang.org/x/tools/cmd/stringer
go install golang.org/x/tools/cmd/goyacc

Install Ragel. On macOS: brew install ragel.

Workflow

go generate
go test

Test just the scanner:

ragel -Z scanner.rl && go test -run TestExpressionParser

Attribution

Michael Hamrah's Lexing with Ragel and Parsing with Yacc using Go was essential to understanding go yacc.